WIP: Use Karma instead of custom-built mocha test-runner in the browser #1694
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.
At the moment, the saucelabs tests are failing for IE and Safari. I already had a short mail-exchange with a customer-support technician, and he suggested we make sure that the following browser-caps are used when calling the SauceLabs API.
I have not succeeded in doing so, so as an alternative I thought we could also use Karma.
This is a work-in-progress PR for this change, but I would like to have some feedback before merging it. What I like about Karma is:
What I don't like:
This may slow down the tests, and I don't know what the impacts on pricing are (it probably doesn't matter, because I think we have a free open-source account at SauceLabs).
However: If we introduce new code for SauceLabs (i.e. the Karma configs), we should also get rid of the old code, but it is stil in use when you run "grunt dev". The usual use case is: You run "grunt dev", point your browser to "http://localhost:9999/spec" and it will run all tests in the browser. I'm not sure if it re-runs tests in the browser after file-changes.
With Karma, you can either choose to let Karma start one browser (or multiple), so when you change a file and save it, a browser will pop-up and run the Karma tests. This might be disturbing.
You can also tell Karma, just to run the server. When you open the browser and point it to the server, the tests will not run until you change a file (at least with the current configuration). This seems counter-intuitive. On the other hand, if you have "grunt dev" running, and multiple browsers pointed to the Karma-server, it will run the tests in all of them, which is pretty cool.
My main concern however is, that you can only have a single entry-point. So in dev-mode, you will not be able to point your browser to "index.html", "amd.html", "umd.html" to test the different build-targets. I don't know if anyone is actually doing this. I usually only run the tests in NodeJs and leave the rest to the CI.
With all that said (and thank you for reading this far):
There is still some work to do here (remove old code, cleanup), but I'd like to have some reassurance first. I'd like to know that I am doing the right thing...