s9tpepper / karma-cucumberjs

A Cucumber.js Karma test runner adapter.
MIT License
54 stars 21 forks source link

Fixed problem with window.__karma__.loaded undefined #16

Closed jrobison153 closed 8 years ago

jrobison153 commented 8 years ago

There's a race condition that makes the load and execution of cucumber tests very flakey. The majority of the time the tests fail to load with error 'window.karma.loaded() undefined'. I've managed to resolve the issue, well at least it works for me now. I had to remove all overloading of the karmaloaded() function, this seemed wrong. As far as I can tell from my research a karma framework should only implement karma.start, that's it.

The second change was to stop calling start() after the adapter was loaded. Calling start() is Karma's job and doing so in the actual framework code seemed to confuse Karma.

Note, I've been running the fixed build against my code without issue now, everything looks good. However, the cucumber/karma tests in this project hang, they start and load but never execute. Not ideal I know, hoping you can take a look and make any final tweaks to get the build back to green.

this fixes #9

jrobison153 commented 8 years ago

need to revise solution