steal-mocha
Provides an easy way to automatically run Mocha tests using StealJS.
Use
Add the Steal tag to your page
This will do the equivalent of
mocha;
and your tests will automatically be ran.
Writing tests
When you write tests just be sure to import steal-mocha
.
; ;
Use with Bower / manually
If you are not using NPM the following configuration is necessary:
System;
mocha.opts
Mocha's runner allows for a mocha.opts file,
specifying addition options such as checkLeaks()
. steal-mocha
does not parsed
a mocha.opts
file, however allows the specification of a startup script.
This is similar to the --require
option in mocha.opts
.
The path in data-mocha-require
is a module name.
test/setup.js
const chai = ;const sinon = ; module { sinonassert;};
The above example extends Chai's assertion library with SinonJS assertions.
License
MIT