Update tests to use karma & work on Travis CI #20
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.
As mentioned in #19 I had some trouble running the tests. It looks like they depend on some stuff that isn't there. However, I wanted to be sure of my changes for that PR, so I did a little bit of work to make the tests run in Karma.
With the current configuration:
npm test
will start up whatever browsers are installed and run the tests once, then shut them down.npm run watch
will similarly start up whatever browsers are there, and then watch the filesystem for changes and run the tests after each change.I'm not sure what your normal build process looks like, but I'm using browserify in the tests. Also, I couldn't find the assertion library that the tests referenced, but the standard node.js assert library seemed to be a drop-in replacement.
Lastly, I added a basic .travis.yml to run the tests automatically on travis-ci.org. You'll have to log in with your github credentials and enable it on this repo, but after that the tests will run automatically on every commit and PR.
There seems to be an issue with the Safari launcher on recent releases of Safari, hopefully that gets resolved soon. It does work in the version that's installed on Travis CI, although it takes about 6x longer than linux, so I just left it disabled. (There's something wrong with testing in Edge there, so I disabled windows also.)