2016-01-05 18:09:12 +00:00
|
|
|
# mocha
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Execute Mocha JavaScript test runner.
|
2019-06-04 10:25:13 +01:00
|
|
|
> More information: <https://mochajs.org>.
|
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
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
`mocha {{directory/with/tests}}`
|
2016-01-05 18:09:12 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Run tests that match a specific grep pattern:
|
2016-01-05 18:09:12 +00:00
|
|
|
|
2021-05-10 10:03:12 +01:00
|
|
|
`mocha --grep {{regular_expression}}`
|
2016-01-05 18:09:12 +00:00
|
|
|
|
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}}`
|