Fixed problem with window.__karma__.loaded undefined #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 karma__loaded() 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