Skip to content

Commit 311a65c

Browse files
committed
test_runner: cover cancelled subtest order and random seed docs
1 parent ae29501 commit 311a65c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/api/test.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ deterministically. Supplying `--test-random-seed` also enables randomization,
660660
so `--test-randomize` is optional when a seed is provided:
661661

662662
```bash
663-
node --test --test-randomize --test-random-seed=12345
663+
node --test --test-random-seed=12345
664664
```
665665

666666
In most test files, randomization works automatically. One important exception
@@ -693,7 +693,7 @@ test('math', async (t) => {
693693
```
694694

695695
Using suite-style APIs such as `describe()`/`it()` or `suite()`/`test()`
696-
still allows randomization, because sibling tests are queued together.
696+
still allows randomization, because sibling tests are enqueued together.
697697

698698
Example: this remains eligible for randomization.
699699

@@ -1676,7 +1676,8 @@ changes:
16761676
**Default:** `false`.
16771677
* `randomSeed` {number} Seed used when randomizing execution order. If this
16781678
option is set, runs can replay the same randomized order deterministically,
1679-
and setting this option also enables randomization.
1679+
and setting this option also enables randomization. The value must be an
1680+
integer between `0` and `4294967295`.
16801681
**Default:** `undefined`.
16811682
* `rerunFailuresFilePath` {string} A file path where the test runner will
16821683
store the state of the tests to allow rerunning only the failed tests on a next run.

lib/internal/test_runner/runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function getRunArgs(path, { forceExit,
216216
if (rerunFailuresFilePath) {
217217
ArrayPrototypePush(runArgs, `--test-rerun-failures=${rerunFailuresFilePath}`);
218218
}
219-
if (randomize === true) {
219+
if (randomize) {
220220
ArrayPrototypePush(runArgs, '--test-randomize');
221221
}
222222
if (randomSeed != null) {

0 commit comments

Comments
 (0)