Skip to content

Commit b431609

Browse files
authored
docs: update browser options
1 parent 883ae4b commit b431609

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/index.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Before Mocha v3.0.0, `this.skip()` was not supported in asynchronous tests and h
674674

675675
You can choose to retry failed tests up to a certain number of times. This feature is designed to handle end-to-end tests (functional tests/Selenium...) where resources cannot be easily mocked/stubbed. **It's not recommended to use this feature for unit tests**.
676676

677-
This feature does re-run `beforeEach/afterEach` hooks but not `before/after` hooks.
677+
This feature does re-run a failed test and its corresponding `beforeEach/afterEach` hooks, but not `before/after` hooks. `this.retries()` has no effect on failing hooks.
678678

679679
**NOTE**: Example below was written using Selenium webdriver (which [overwrites global Mocha hooks][selenium-webdriver-testing] for `Promise` chain).
680680

@@ -739,7 +739,7 @@ $ mocha
739739

740740
<h2 id="test-duration">Test duration</h2>
741741

742-
Many reporters will display test duration and flag tests that are slow (default: 75ms), as shown here with the "spec" reporter:
742+
Many reporters will display test duration and flag tests that are slow (default: 75ms), as shown here with the SPEC reporter:
743743

744744
![test duration](images/reporter-spec-duration.png?withoutEnlargement&resize=920,9999){:class="screenshot" lazyload="on"}
745745

@@ -813,7 +813,7 @@ Again, use `this.timeout(0)` to disable the timeout for a hook.
813813
814814
## Diffs
815815

816-
Mocha supports the `err.expected` and `err.actual` properties of any thrown `AssertionError`s from an assertion library. Mocha will attempt to display the difference between what was expected, and what the assertion actually saw. Here's an example of a "string" diff:
816+
Mocha supports the `err.expected` and `err.actual` properties of any thrown `AssertionError`s from an assertion library. Mocha will attempt to display the difference between what was expected, and what the assertion actually saw. Here's an example of a "string" diff using `--inline-diffs`:
817817

818818
![string diffs](images/reporter-string-diffs.png?withoutEnlargement&resize=920,9999){:class="screenshot" lazyload="on"}
819819

@@ -1068,7 +1068,7 @@ By default, Mocha will search for a config file if `--config` is not specified;
10681068

10691069
### `--opts <path>`
10701070

1071-
> _Deprecated._
1071+
> _Deprecated in v7.0.0._
10721072
10731073
Specify a path to [`mocha.opts`](#mochaopts).
10741074

@@ -1598,11 +1598,18 @@ mocha.setup({
15981598
ui: 'tdd'
15991599
});
16001600

1601-
// Use "tdd" interface, check global leaks, and force all tests to be asynchronous
1601+
// Examples of options:
16021602
mocha.setup({
1603-
ui: 'tdd',
1603+
asyncOnly: true,
1604+
bail: true,
16041605
checkLeaks: true,
1605-
asyncOnly: true
1606+
forbidOnly: true,
1607+
forbidPending: true,
1608+
global: ['MyLib'],
1609+
retries: 3,
1610+
slow: '100',
1611+
timeout: '2000',
1612+
ui: 'bdd'
16061613
});
16071614
```
16081615

@@ -1623,7 +1630,7 @@ If set to `true`, do not attempt to use syntax highlighting on output test code.
16231630

16241631
### Reporting
16251632

1626-
The "html" reporter is the default reporter when running Mocha in the browser. It looks like this:
1633+
The HTML reporter is the default reporter when running Mocha in the browser. It looks like this:
16271634

16281635
![HTML test reporter](images/reporter-html.png?withoutEnlargement&resize=920,9999){:class="screenshot" lazyload="on"}
16291636

0 commit comments

Comments
 (0)