Write isomorphic tests for your isomorphic library
This tool is designed to make writing plugins for isomorphic-git easier. It consists of all the hacks I used to write isomorphic-git's own unit tests. I extracted all the hackery and bundled it into this command line tool.
Tests are written in Jasmine, because it works in the browser.
Tests can require file system fixtures using FixtureFS().
Place each fixture into a separate directory by name, inside the __tests__/__fixtures__
directory.
The test runner starts its own git server.
Any directories in __tests__/__gitrepos__
will be served as git fixtures.
Jest-style snapshots are saved in __tests__/__snapshots__
.
They must be loaded manually however, using 'registerSnapshots'.
The 'nockback' library allows you to capture and replay HTTP responses delivered to your tests.
Get rid of those slow flaky "real" http requests and enjoy fast, predictable responses to your requests.
Nockback fixtures go in the __tests__/__nockbacks__
directory.
To run tests use:
./node_modules/.bin/isomorphic-test [options]
or add to your package.json
:
"scripts": {
"test": "isomorphic-test [options]"
}
where [options]
are the command line options to control which browsers and tests are run:
Usage: isomorphic-test [options] [test-filename-to-match]
--node, -n
--firefox, -f
--chrome, -c
--watch, -w