tldr/pages/common/mocha.md

24 lines
468 B
Markdown
Raw Normal View History

2016-01-05 18:09:12 +00:00
# mocha
> Execute Mocha JavaScript test runner.
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 {{^regex$}}`
- 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}}`