Run package specs in Atom using Mocha and Chai.
Run npm install atom-mocha --save-dev
in your package's directory.
If nothing's happening:
- Check your
package.json
file contains"atomTestRunner": "atom-mocha"
- Atom may have cached your package's metadata. Refresh it by quitting and restarting the program.
If you're still experiencing difficulties, please file an issue.
To pass options to Mocha, place a .mocharc.{js,json,yml}
file in your package's base directory.
(or in your specs folder, whichever you prefer).
Alternatively, you can use package.json
's "mocha":
property instead:
{
"mocha": {
"bail": true,
"ui": "bdd"
}
}
For details on Mocha's configuration settings, consult their documentation. Options specific to this spec-runner are described in depth here.
- Chai's expect function is automatically globalised for you.
- Nifty extras are available to help with writing tests.
- Reload the spec-runner window by pressing Ctrl/Cmd + R.
- Tests can be batch-toggled by Alt-clicking their title.