tldr/pages/common/mocha.md

25 lines
522 B
Markdown
Raw Permalink Normal View History

2016-01-05 18:09:12 +00:00
# mocha
> 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
- Run tests with default configuration or as configured in `mocha.opts`:
2016-01-05 18:09:12 +00:00
`mocha`
- Run tests contained at a specific location:
2016-01-05 18:09:12 +00:00
`mocha {{directory/with/tests}}`
2016-01-05 18:09:12 +00:00
- Run tests that match a specific grep pattern:
2016-01-05 18:09:12 +00:00
`mocha --grep {{regular_expression}}`
2016-01-05 18:09:12 +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`
- Run tests with a specific reporter:
2016-01-05 18:09:12 +00:00
`mocha --reporter {{reporter}}`