You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should all test files run in parallel. Setting this to `false` will override `maxWorkers` and `minWorkers` options to `1`.
890
+
891
+
::: tip
892
+
This option doesn't affect tests running in the same file. If you want to run those in parallel, use `concurrent` option on [describe](/api/#describe-concurrent) or via [a config](#sequence-concurrent).
893
+
:::
894
+
895
+
### maxWorkers
896
+
897
+
-**Type:**`number`
898
+
-**Version:** Since Vitest 1.1
899
+
900
+
Maximum number of workers to run tests in. `poolOptions.{threads,vmThreads}.maxThreads`/`poolOptions.forks.maxForks` has higher priority.
901
+
902
+
### minWorkers
903
+
904
+
-**Type:**`number`
905
+
-**Version:** Since Vitest 1.1
906
+
907
+
Minimum number of workers to run tests in. `poolOptions.{threads,vmThreads}.minThreads`/`poolOptions.forks.minForks` has higher priority.
Copy file name to clipboardexpand all lines: docs/guide/cli.md
+3
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,9 @@ Run only [benchmark](https://vitest.dev/guide/features.html#benchmarking-experim
73
73
|`--poolOptions <options>`| Specify pool options |
74
74
|`--poolOptions.threads.isolate`| Isolate tests in threads pool (default: `true`) |
75
75
|`--poolOptions.forks.isolate`| Isolate tests in forks pool (default: `true`) |
76
+
|`--fileParallelism`| Should all test files run in parallel. Use --no-parallelism to disable (default: true) |
77
+
|`--maxWorkers`| Maximum number of workers to run tests in |
78
+
|`--minWorkers`| Minimum number of workers to run tests in |
76
79
|`--silent`| Silent console output from tests |
77
80
|`--reporter <name>`| Select reporter: `default`, `verbose`, `dot`, `junit`, `json`, or a path to a custom reporter |
78
81
|`--outputFile <filename/-s>`| Write test results to a file when the `--reporter=json` or `--reporter=junit` option is also specified <br /> Via [cac's dot notation] you can specify individual outputs for multiple reporters |
If you are using Vitest 1.1 or higher, you can also just provide `--no-parallelism` flag:
66
+
67
+
```sh
68
+
# If pool is unknown
69
+
vitest --inspect-brk --no-file-parallelism
70
+
```
71
+
65
72
Once Vitest starts it will stop execution and wait for you to open developer tools that can connect to [Node.js inspector](https://nodejs.org/en/docs/guides/debugging-getting-started/). You can use Chrome DevTools for this by opening `chrome://inspect` on browser.
66
73
67
74
In watch mode you can keep the debugger open during test re-runs by using the `--poolOptions.threads.isolate false` options.
Copy file name to clipboardexpand all lines: test/config/test/failures.test.ts
+3-3
Original file line number
Diff line number
Diff line change
@@ -33,19 +33,19 @@ test('shard index must be smaller than count', async () => {
33
33
test('inspect requires changing pool and singleThread/singleFork',async()=>{
34
34
const{ stderr }=awaitrunVitest({inspect: true})
35
35
36
-
expect(stderr).toMatch('Error: You cannot use --inspect without "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"')
36
+
expect(stderr).toMatch('Error: You cannot use --inspect without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"')
37
37
})
38
38
39
39
test('inspect cannot be used with multi-threading',async()=>{
expect(stderr).toMatch('Error: You cannot use --inspect without "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"')
42
+
expect(stderr).toMatch('Error: You cannot use --inspect without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"')
43
43
})
44
44
45
45
test('inspect-brk cannot be used with multi processing',async()=>{
expect(stderr).toMatch('Error: You cannot use --inspect without "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"')
48
+
expect(stderr).toMatch('Error: You cannot use --inspect without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"')
49
49
})
50
50
51
51
test('c8 coverage provider is not supported',async()=>{
0 commit comments