Skip to content

Commit

Permalink
Added documentation regarding the available options for mocha in brow…
Browse files Browse the repository at this point in the history
…ser.

Add the JSON Stream name that is recommended in the documentation as an alias for the json-stream recommender.
Issue #1592 (You can specify a the constructor of your custom reporter in options and mocha will use it)
  • Loading branch information
Lindsay-Needs-Sleep committed Sep 24, 2019
1 parent eed38d7 commit 67686eb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,36 @@ mocha.setup({
});
```

Available options:
```
allowUncaught {boolean} - Propagate uncaught errors?
asyncOnly {boolean} - Force `done` callback or promise?
bail {boolean} - Bail after first test failure?
checkLeaks {boolean} - If true, check leaks.
delay {boolean} - Delay root suite execution?
enableTimeouts {boolean} - Enable timeouts?
fgrep {string} - Test filter given string.
forbidOnly {boolean} - Tests marked `only` fail the suite?
forbidPending {boolean} - Pending tests fail the suite?
fullStackTrace {boolean} - Full stacktrace upon failure?
global {string[]} - Variables expected in global scope.
grep {RegExp|string} - Test filter given regular expression.
growl {boolean} - Enable desktop notifications?
hideDiff {boolean} - Suppress diffs from failures?
ignoreLeaks {boolean} - Ignore global leaks?
invert {boolean} - Invert test filter matches?
noHighlighting {boolean} - Disable syntax highlighting?
reporter {string|constructor} - Reporter** name or constructor.
reporterOption {Object} - Reporter settings object.
retries {number} - Number of times to retry failed tests.
slow {number} - Slow threshold value.
timeout {number|string} - Timeout threshold value.
ui {string} - Interface name.
color {boolean} - Color TTY output from reporter?
useInlineDiffs {boolean} - Use inline diffs?
```
\** Available built in reporters that can be referenced by name [here](#reporters), and recommended reporters for the browser [here](#reporting).

### Browser-specific Option(s)

The following option(s) _only_ function in a browser context:
Expand Down
2 changes: 1 addition & 1 deletion lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ exports.Test = require('./test');
* @param {boolean} [options.inlineDiffs] - Display inline diffs?
* @param {boolean} [options.invert] - Invert test filter matches?
* @param {boolean} [options.noHighlighting] - Disable syntax highlighting?
* @param {string} [options.reporter] - Reporter name.
* @param {string|constructor} [options.reporter] - Reporter name or constructor.
* @param {Object} [options.reporterOption] - Reporter settings object.
* @param {number} [options.retries] - Number of times to retry failed tests.
* @param {number} [options.slow] - Slow threshold value.
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ exports.XUnit = exports.xunit = require('./xunit');
exports.Markdown = exports.markdown = require('./markdown');
exports.Progress = exports.progress = require('./progress');
exports.Landing = exports.landing = require('./landing');
exports.JSONStream = exports['json-stream'] = require('./json-stream');
exports.JSONStream = exports['json-stream'] = exports['JSON stream'] = require('./json-stream');

0 comments on commit 67686eb

Please sign in to comment.