Closed mattdell closed 5 years ago
I've figured out one piece of the puzzle and discovered another issue. It seems my tests timeout because they don't run. If I go to the URL where karma server is running then the tests execute.
I've attached what is probably the dullest video ever, but if you start at 0:55 then you'll see some action. After that it does absolutely nothing until it hits a 100 second timeout that I put in place (rather than the default 10).
https://www.dropbox.com/s/g8d83mbl4qrhoaz/jsdom-karma.mov?dl=0
I now seem to be in a similar place to Issue #4.
Hi, @mattdell
I can't seem to replicate the issue you're describing. Can you provide a minimal working example?
+1, I also have this exact issue
+1 I also have this issue. Node 7.4.0 does not solve this issue
I doubt everyone experiencing this issue has the same root cause, but for me it is caused by a polyfill for setImmediate
that was introduced in timers-browserify 2.0, which is a dependency of node-libs-browser 2.0, which is a dependency of webpack as of 2.1.0-beta.28. If I use beta.27, the problem goes away. Shrinkwrapping timers-browserify to 1.4.2 (before the polyfill was introduced) also resolves the issue.
Here is the commit in question: https://github.com/jryans/timers-browserify/commit/48f38e6c7ecb22fb51cc0870c1a2e8a2e16ba700
We are having a somewhat similar issue. In our setup, we are using Webpack@2.2.1 together with the karma-jsdom-launcher and the karma-mocha-reporter. As it turns out, reporter output seems to be aggregated and displayed only once every 50 tests. If I put a console.log into each test, those logs appear at about the right time. The problem ist that for long running tests, there can be no output for quite some time which is interpreted by (I assume?) mocha as a test timeout. Our current hacky solution is to add a global afterEach which logs a simple number to tell mocha we are still alive. A somewhat more substantial solution would be preferred, however. @dn-rob I did not get this to work, unfortunately, maybe it is a different issue?
Seems that NodeJS version matters. I had 7.4.0 and tests failed but rolling back to latest LTS version (6.10.2) tests started to run.
Closing due to inactivity. Anyone who continues to experience the issue are encouraged to say so, but please construct a minimal example that consistently produce the error (containing a package-lock and the used node version).
I've got jsdom up and running so that when I run mocha my tests pass fine. I've now converted my karma config to use the jsdom runner instead of phantomjs. For some reason though the tests don't seem to execute.
This is what I get after a 10 second timeout:
I don't see a lot of documentation here so I'm a bit lost. Have I forgotten a step?