From b0f0238691f2f08fdc2610889b8bdc968cde4cbd Mon Sep 17 00:00:00 2001 From: richiemccoll Date: Tue, 31 Jan 2023 18:50:59 +0200 Subject: [PATCH] docs: update test concurrency description / default values PR-URL: https://github.com/nodejs/node/pull/46457 Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca Reviewed-By: Jacob Smith (cherry picked from commit 7d68b7bbfc9ffbd2ad0913972ac0b1a315679b06) --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 28dceaf..44d70f6 100644 --- a/README.md +++ b/README.md @@ -597,11 +597,10 @@ added: REPLACEME properties are supported: * `concurrency` {number|boolean} If a number is provided, then that many files would run in parallel. - If truthy, it would run (number of cpu cores - 1) - files in parallel. - If falsy, it would only run one file at a time. - If unspecified, subtests inherit this value from their parent. - **Default:** `true`. + If `true`, it would run `os.availableParallelism() - 1` test files in + parallel. + If `false`, it would only run one test file at a time. + **Default:** `false`. * `files`: {Array} An array containing the list of files to run. **Default** matching files from [test runner execution model][]. * `signal` {AbortSignal} Allows aborting an in-progress test execution. @@ -631,10 +630,9 @@ run({ files: [path.resolve('./tests/test.js')] }) properties are supported: - `concurrency` {number|boolean} If a number is provided, then that many tests would run in parallel. - If truthy, it would run (number of cpu cores - 1) - tests in parallel. + If `true`, it would run `os.availableParallelism() - 1` tests in parallel. For subtests, it will be `Infinity` tests in parallel. - If falsy, it would only run one test at a time. + If `false`, it would only run one test at a time. If unspecified, subtests inherit this value from their parent. **Default:** `false`. - `only` {boolean} If truthy, and the test context is configured to run @@ -1335,9 +1333,12 @@ execution of the test function. This function does not return a value. `fn` does not have a name. - `options` {Object} Configuration options for the subtest. The following properties are supported: - - `concurrency` {number} The number of tests that can be run at the same time. + - `concurrency` {number|boolean|null} If a number is provided, + then that many tests would run in parallel. + If `true`, it would run all subtests in parallel. + If `false`, it would only run one test at a time. If unspecified, subtests inherit this value from their parent. - **Default:** `1`. + **Default:** `null`. - `only` {boolean} If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped. **Default:** `false`.