Skip to content

Commit 6f10d12

Browse files
docs: replace "New in" with "Since" in version annotations (#5262)
* docs: replace "New in" with "Since" in version annotations * Change version annotations from "New in vX.Y.Z" to "Since vX.Y.Z" * Align with Node.js documentation style convention * Improve clarity for users upgrading from older versions Closes #5166 * Update docs/index.md Co-authored-by: Josh Goldberg ✨ <[email protected]> * fix typo --------- Co-authored-by: Josh Goldberg ✨ <[email protected]>
1 parent f729cd0 commit 6f10d12

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

docs/index.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ Use this option to have Mocha check for global variables that are leaked while r
903903
904904
### `--dry-run`
905905

906-
> _New in v9.0.0_ Report tests without executing any of them, neither tests nor hooks.
906+
> _Since v9.0.0_ Report tests without executing any of them, neither tests nor hooks.
907907
908908
### `--exit`
909909

@@ -928,13 +928,13 @@ To ensure your tests aren't leaving messes around, here are some ideas to get st
928928

929929
### `--pass-on-failing-test-suite`
930930

931-
> _New in v10.7.0_
931+
> _Since v10.7.0_
932932
933933
If set to `true`, Mocha returns exit code `0` even if there are failed tests during run.
934934

935935
### `--fail-zero`
936936

937-
> _New in v9.1.0_
937+
> _Since v9.1.0_
938938
939939
Fail test run if no tests are encountered with `exit-code: 1`.
940940

@@ -1008,7 +1008,7 @@ Some assertion libraries will supply their own diffs, in which case Mocha's will
10081008

10091009
Mocha's own diff output does not conform to any known standards, and is designed to be human-readable.
10101010

1011-
> _New in v9.2.1_
1011+
> _Since v9.2.1_
10121012
10131013
By default strings are truncated to 8192 characters before generating a diff. This is to prevent performance problems with large strings.
10141014

@@ -1048,15 +1048,15 @@ Can be specified as a comma-delimited list.
10481048

10491049
### `--config <path>`
10501050

1051-
> _New in v6.0.0_
1051+
> _Since v6.0.0_
10521052
10531053
Specify an explicit path to a [configuration file](#configuring-mocha-nodejs).
10541054

10551055
By default, Mocha will search for a config file if `--config` is not specified; use `--no-config` to suppress this behavior.
10561056

10571057
### `--node-option <name>, -n <name>`
10581058

1059-
> _New in v9.1.0_
1059+
> _Since v9.1.0_
10601060
10611061
For Node.js and V8 options. Mocha forwards these options to Node.js by spawning a new child-process.<br>
10621062
The options are set without leading dashes `--`, e.g. `-n require=foo -n unhandled-rejections=strict`
@@ -1069,7 +1069,7 @@ Can also be specified as a comma-delimited list: `-n require=foo,unhandled-rejec
10691069
10701070
### `--package <path>`
10711071

1072-
> _New in v6.0.0_
1072+
> _Since v6.0.0_
10731073
10741074
Specify an explicit path to a [`package.json` file](#configuring-mocha-nodejs) (ostensibly containing configuration in a `mocha` property).
10751075

@@ -1083,7 +1083,7 @@ Specifying `--extension` will _remove_ `.js` as a test file extension; use `--ex
10831083

10841084
The option can be given multiple times. The option accepts a comma-delimited list: `--extension a,b` is equivalent to `--extension a --extension b`.
10851085

1086-
> _New in v8.2.0_
1086+
> _Since v8.2.0_
10871087
10881088
`--extension` now supports multipart extensions (e.g., `spec.js`), leading dots (`.js`) and combinations thereof (`.spec.js`);
10891089

@@ -1104,7 +1104,7 @@ Files specified in this way should contain one or more suites, tests or hooks. I
11041104
Explicitly ignore one or more test files, directories or globs (e.g., `some/**/files*`) that would otherwise be loaded.<br>
11051105
Can be specified multiple times.
11061106

1107-
> _New in v10.0.0:_ In Windows always use forward-slashes `/` as path separator.
1107+
> _Since v10.0.0:_ In Windows always use forward-slashes `/` as path separator.
11081108
11091109
Files specified using `--file` _are not affected_ by this option.
11101110

@@ -1144,7 +1144,7 @@ Tests may be rerun manually by typing &#x24e1; &#x24e2; &#x23ce; (same shortcut
11441144

11451145
### `--watch-files <file|directory|glob>`
11461146

1147-
> _New in v7.0.0_
1147+
> _Since v7.0.0_
11481148
11491149
List of paths or globs to watch when `--watch` is set. If a file matching the given glob changes or is added or removed mocha will rerun all tests.
11501150

@@ -1156,7 +1156,7 @@ The option can be given multiple times. The option accepts a comma-delimited lis
11561156

11571157
### `--watch-ignore <file|directory|glob>`
11581158

1159-
> _New in v7.0.0_
1159+
> _Since v7.0.0_
11601160
11611161
List of paths or globs to exclude from watching. Defaults to `node_modules` and `.git`.
11621162

@@ -1223,7 +1223,7 @@ Implies `--timeout 0`.
12231223

12241224
### `--parallel, -p`
12251225

1226-
> _New in v.8.0.0._
1226+
> _Since v.8.0.0._
12271227
12281228
Use the `--parallel` flag to run tests in a worker pool.
12291229

@@ -1233,7 +1233,7 @@ Each test file will be put into a queue and executed as workers become available
12331233

12341234
### `--jobs <count>, -j <count>`
12351235

1236-
> _New in v.8.0.0._
1236+
> _Since v.8.0.0._
12371237
12381238
Use `--jobs <count>` to specify the _maximum_ number of processes in the worker pool.
12391239

@@ -1259,11 +1259,11 @@ These flags vary depending on your version of Node.js.
12591259

12601260
`node` flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs).
12611261

1262-
> _New in v9.1.0_ You can also pass `node` flags to Node.js using [`--node-option`](#-node-option-name-n-name).
1262+
> _Since v9.1.0_ You can also pass `node` flags to Node.js using [`--node-option`](#-node-option-name-n-name).
12631263
12641264
### `--enable-source-maps`
12651265

1266-
> _New in Node.js v12.12.0_
1266+
> _Since Node.js v12.12.0_
12671267
12681268
If the [`--enable-source-maps`](https://nodejs.org/dist/latest-v12.x/docs/api/cli.html#cli_enable_source_maps) flag
12691269
is passed to mocha, source maps will be collected and used to provide accurate stack traces for transpiled code:
@@ -1280,11 +1280,11 @@ Prepend `--v8-` to any flag listed in the output of `node --v8-options` (excludi
12801280

12811281
V8 flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs).
12821282

1283-
> _New in v9.1.0_ You can also pass V8 flags (without `--v8-`) to Node.js using [`--node-option`](#-node-option-name-n-name).
1283+
> _Since v9.1.0_ You can also pass V8 flags (without `--v8-`) to Node.js using [`--node-option`](#-node-option-name-n-name).
12841284
12851285
## Parallel Tests
12861286

1287-
> _New in v.8.0.0._
1287+
> _Since v.8.0.0._
12881288
12891289
Depending on the number and nature of your tests, you may find a significant performance benefit when running tests in parallel (using the [`--parallel`](#-parallel-p) flag).
12901290

@@ -1411,13 +1411,13 @@ It's unlikely (but not impossible) to see a performance gain from a [job count](
14111411

14121412
### Parallel Mode Worker IDs
14131413

1414-
> _New in v9.2.0_
1414+
> _Since v9.2.0_
14151415
14161416
Each process launched by parallel mode is assigned a unique id, from 0 for the first process to be launched, to N-1 for the Nth process. This worker id may be accessed in tests via the environment variable `MOCHA_WORKER_ID`. It can be used for example to assign a different database, service port, etc for each test process.
14171417

14181418
## Root Hook Plugins
14191419

1420-
> _New in v8.0.0_
1420+
> _Since v8.0.0_
14211421
14221422
In some cases, you may want a [hook](#hooks) before (or after) every test in every file. These are called _root hooks_. Previous to v8.0.0, the way to accomplish this was to use `--file` combined with root hooks (see [example above](#root-hooks-are-not-global)). This still works in v8.0.0, but _not_ when running tests in parallel mode! For that reason, running root hooks using this method is _strongly discouraged_, and may be deprecated in the future.
14231423

@@ -1643,7 +1643,7 @@ If you're a library maintainer, and your library uses root hooks, you can migrat
16431643

16441644
## Global Fixtures
16451645

1646-
> _New in v8.2.0_
1646+
> _Since v8.2.0_
16471647
16481648
At first glance, _global fixtures_ seem similar to [root hooks](#root-hook-plugins). However, unlike root hooks, global fixtures:
16491649

@@ -2088,7 +2088,7 @@ Alias: `HTML`, `html`
20882088

20892089
## Node.JS native ESM support
20902090

2091-
> _New in v7.1.0_
2091+
> _Since v7.1.0_
20922092
20932093
Mocha supports writing your tests as ES modules, and not just using CommonJS. For example:
20942094

@@ -2214,7 +2214,7 @@ The HTML reporter is the default reporter when running Mocha in the browser. It
22142214

22152215
## Configuring Mocha (Node.js)
22162216

2217-
> _New in v6.0.0_
2217+
> _Since v6.0.0_
22182218
22192219
Mocha supports configuration files, typical of modern command-line tools, in several formats:
22202220

@@ -2310,7 +2310,7 @@ _Note_: Double quotes around the glob are recommended for portability.
23102310

23112311
## Error Codes
23122312

2313-
> _New in v6.0.0_
2313+
> _Since v6.0.0_
23142314
23152315
When Mocha itself throws exception, the associated `Error` will have a `code` property. Where applicable, consumers should check the `code` property instead of string-matching against the `message` property. The following table describes these error codes:
23162316

0 commit comments

Comments
 (0)