Comments (11)
Got a repo or gist that reproduces?
from mocha-chrome.
Not right now. I can look into that. It's a bit cumbersome since it's requirejs
. Anyway I think the above doesn't make sense in that case since it's async. I'm calling mocha.delay()
that adds a global run
function that I later can call when all test files are required
from mocha-chrome.
Depends on the version of Require.js being used, but we add the following to our test runner template:
<script>
require([], function () {
mocha.run();
});
</script>
That queues mocha.run
until Require is done doing it's thing, all modules are defined, and all requires are ready. mocha.delay
is another option.
from mocha-chrome.
I just tried a minimal sample with a gist
00:28 $ npx mocha-chrome https://rawgit.com/stoffeastrom/ecee627fdfd06bf9f29eabf7bb76873e/raw/c25c501676bbeb8a0c982340ab92807be0549264/index.html
function
Test
✓ should work
1 passing (19ms)
and it worked. I suspect it might have to do with the mocha.delay
but needs more investigation. Anyway, a cool way to run a gist :)
from mocha-chrome.
So heres the repro
mocha-chrome https://rawgit.com/stoffeastrom/ecee627fdfd06bf9f29eabf7bb76873e/raw/84ca1c2c98a0fd870a7a9464be505916bcaba6f3/index.html
yields
Mocha-Chrome Failed: mocha.run() was called with no tests
If you get load timeout just run it again
from mocha-chrome.
I ran this locally and this seems to fix it for me
from mocha-chrome.
@stoffeastrom I'm having a really hard time following you. It's a best practice when reporting and discussing an issue to be clear and linear in your thoughts, as issue discussions are linear like a discussion forum. It's also a good practice not to post multiple successive posts, but rather edit your last post if there are no replies.
Your "repo" isn't a test repo; it's not even a suite of tests. It's an html file with no tests and just a mocha.delay
call. So your issue seems to be claiming now that mocha saying there aren't any tests is incorrect, even though your test file contains no tests.
At this point I honestly have no idea what you're trying to report.
from mocha-chrome.
@shellscape Sorry for the confusion! As i linked before. This gist indeed has a test file. Just clone it and you will see. Problem occurs when using mocha.delay
. When the browser shim is emitting started
there isn't any tests loaded yet and mocha-chrome
errors out. If I change it to instead emit on runner start it works.
from mocha-chrome.
Did you try what I posted in #13 (comment) ? And if so, did it work?
from mocha-chrome.
Yes I tried only using the mocha.run
and that works.
from mocha-chrome.
OK so that's the route you'll want to go for testing with RequireJS.
Using the m.runner
start event presents other concurrency issues that are problematic, which is why we didn't use that originally. That's based off of the same procedure that mocha-phantomjs-core uses, and that project dealt with the same concurrency issues in the past.
I'll also add a test using RequireJS to the test suite as a proof-of-concept for others on RequireJS moving forward.
from mocha-chrome.
Related Issues (19)
- net::ERR_INSECURE_RESPONSE when protocol is https HOT 1
- mocha-chrome: unexpected token HOT 6
- Add a pre exit hook HOT 4
- Feature request: Pass args to chrome HOT 17
- Unicode characters become garbled on Windows HOT 7
- Feature request: Allow customization/confguration of the mocha start timeout HOT 5
- test failure results in orphaned chrome.exe processes HOT 7
- Ability to save results to file, like mocha-phantomjs HOT 4
- 'Error: no test specified'
- feature request: override default chrome parameters HOT 3
- Custom reporter suggestion HOT 1
- test failures with recent builds of chrome HOT 3
- With xunit reporter, output is inconsistent, and output option can't be set HOT 1
- mocha's output is always uncolorified HOT 2
- how to debug, mocha-chrome not detecting mocha.run
- Is this still maintained? HOT 2
- Add support of Node 6.x HOT 4
- Unexpected token function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mocha-chrome.