From 5053a5dd7ed9887d7684fba2156394c4e9ea89e7 Mon Sep 17 00:00:00 2001 From: Yuta Nakamura Date: Sun, 31 Dec 2023 19:43:38 +0900 Subject: [PATCH] fix: correct option name `--no-parallelism` (#4831) --- docs/guide/cli.md | 2 +- docs/guide/debugging.md | 2 +- packages/vitest/src/node/config.ts | 2 +- test/config/test/failures.test.ts | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/guide/cli.md b/docs/guide/cli.md index fc8140e9baa9..76b7fabb74da 100644 --- a/docs/guide/cli.md +++ b/docs/guide/cli.md @@ -73,7 +73,7 @@ Run only [benchmark](https://vitest.dev/guide/features.html#benchmarking-experim | `--poolOptions ` | Specify pool options | | `--poolOptions.threads.isolate` | Isolate tests in threads pool (default: `true`) | | `--poolOptions.forks.isolate` | Isolate tests in forks pool (default: `true`) | -| `--fileParallelism` | Should all test files run in parallel. Use --no-parallelism to disable (default: true) | +| `--fileParallelism` | Should all test files run in parallel. Use --no-file-parallelism to disable (default: true) | | `--maxWorkers` | Maximum number of workers to run tests in | | `--minWorkers` | Minimum number of workers to run tests in | | `--silent` | Silent console output from tests | diff --git a/docs/guide/debugging.md b/docs/guide/debugging.md index 97ecaebe3341..e827d85ac525 100644 --- a/docs/guide/debugging.md +++ b/docs/guide/debugging.md @@ -62,7 +62,7 @@ vitest --inspect-brk --pool threads --poolOptions.threads.singleThread vitest --inspect-brk --pool forks --poolOptions.forks.singleFork ``` -If you are using Vitest 1.1 or higher, you can also just provide `--no-parallelism` flag: +If you are using Vitest 1.1 or higher, you can also just provide `--no-file-parallelism` flag: ```sh # If pool is unknown diff --git a/packages/vitest/src/node/config.ts b/packages/vitest/src/node/config.ts index 55ea0813a500..74c4caea2c37 100644 --- a/packages/vitest/src/node/config.ts +++ b/packages/vitest/src/node/config.ts @@ -134,7 +134,7 @@ export function resolveConfig( if (resolved.fileParallelism && !isSingleThread && !isSingleFork) { const inspectOption = `--inspect${resolved.inspectBrk ? '-brk' : ''}` - throw new Error(`You cannot use ${inspectOption} without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"`) + throw new Error(`You cannot use ${inspectOption} without "--no-file-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"`) } } diff --git a/test/config/test/failures.test.ts b/test/config/test/failures.test.ts index aa9c688a5207..34cbc11e7f8c 100644 --- a/test/config/test/failures.test.ts +++ b/test/config/test/failures.test.ts @@ -33,19 +33,19 @@ test('shard index must be smaller than count', async () => { test('inspect requires changing pool and singleThread/singleFork', async () => { const { stderr } = await runVitest({ inspect: true }) - expect(stderr).toMatch('Error: You cannot use --inspect without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"') + expect(stderr).toMatch('Error: You cannot use --inspect without "--no-file-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"') }) test('inspect cannot be used with multi-threading', async () => { const { stderr } = await runVitest({ inspect: true, pool: 'threads', poolOptions: { threads: { singleThread: false } } }) - expect(stderr).toMatch('Error: You cannot use --inspect without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"') + expect(stderr).toMatch('Error: You cannot use --inspect without "--no-file-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"') }) test('inspect-brk cannot be used with multi processing', async () => { const { stderr } = await runVitest({ inspect: true, pool: 'forks', poolOptions: { forks: { singleFork: false } } }) - expect(stderr).toMatch('Error: You cannot use --inspect without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"') + expect(stderr).toMatch('Error: You cannot use --inspect without "--no-file-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"') }) test('c8 coverage provider is not supported', async () => {