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.
This is a replacement for PR #37.
You will notice that the coverage goes down significantly and this is normal. I'll go into detail about it later.
Short version
The problem
I finally figured out why things weren't working here. It's because the current tests are run against
lib
and we want to map them tosrc
. The solution is to run the tests againstsrc
directly. I haven't really looked into how that would go for the mocha + node combination. But since I've figured it out for karma I decided to run coverage in karma instead (shouldn't be any drawbacks).Why coverage is so low
Because karma is doing the coverage against
src
and all the current tests are done againstlib
the coverage ignores those tests. I've added aGremlinClientTest.js
demonstrating a test that does proper coverage (you can see this in coveralls).We have two options here. We either adapt the current tests to use src (including mocha+node configuration). Or we add a new set of (slightly redundant) tests just like
GremlinClientTest
Long Version
Added all the required dependencies for karma.
Updated babel and some other dependencies.
Removed Gulp references (I think we don't care for this anymore?)
Same for browserify
Added Karma configuration. this file is self explanatory for the most part (should be properly commented, but let me know if something looks weird. Bellow is some of the less clear stuff:
We load a tests.webpack.js into karma and karma runs all it's tests agains this file. This file goes into the
test
folder and retrieves all*Test.js
files. It runs these tests (hence the renaming of files).I've provided a few
npm run test:*
commands, the difference betweentest:browser
andtest:browser:debug
is that the debug leaves the browser open. The error messages there make often more sense than the ones in the terminal.Firefox is required. Phantom.js has a few issues that are a pain to deal with. Besides Firefox is also supported by travis.
Added a test, we can remove this depending on the direct we take to improve coverage
I think that's it