2016-01-05 18:09:12 +00:00
|
|
|
# mocha
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Execute Mocha JavaScript test runner.
|
2016-01-05 18:09:12 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run tests with default configuration or as configured in `mocha.opts`:
|
2016-01-05 18:09:12 +00:00
|
|
|
|
|
|
|
`mocha`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run tests contained at a specific location:
|
2016-01-05 18:09:12 +00:00
|
|
|
|
|
|
|
`mocha {{folder/with/tests}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run tests that match a specific grep pattern:
|
2016-01-05 18:09:12 +00:00
|
|
|
|
|
|
|
`mocha --grep {{^regex$}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run tests on changes to JavaScript files in the current directory and once initially:
|
2016-01-05 18:09:12 +00:00
|
|
|
|
|
|
|
`mocha --watch`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run tests with a specific reporter:
|
2016-01-05 18:09:12 +00:00
|
|
|
|
|
|
|
`mocha --reporter {{reporter}}`
|