Skip to content

Commit 63c62f9

Browse files
authoredMar 18, 2023
feat: --test-timeout CLI argument (#3019)
1 parent 3573032 commit 63c62f9

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed
 

‎docs/config/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ This can improve performance in some cases, but might cause segfault in older No
536536

537537
- **Type:** `number`
538538
- **Default:** `5000`
539+
- **CLI:** `--test-timeout=5000`
539540

540541
Default timeout of a test in milliseconds
541542

‎docs/guide/debugging.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: Debugging | Guide
44

55
# Debugging
66

7+
:::tip
8+
When debugging tests you might want to use `--test-timeout` CLI argument to prevent tests from timing out when stopping at breakpoints.
9+
:::
10+
711
## VSCode
812

913
Quick way to debug tests in VSCode is via `JavaScript Debug Terminal`. Open a new `JavaScript Debug Terminal` and run `npm run test` or `vitest` directly. *this works with any code ran in Node, so will work with most JS testing frameworks*

‎packages/vitest/src/node/cli.ts

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ cli
4848
.option('--no-color', 'Removes colors from the console output')
4949
.option('--inspect', 'Enable Node.js inspector')
5050
.option('--inspect-brk', 'Enable Node.js inspector with break')
51+
.option('--test-timeout <time>', 'Default timeout of a test in milliseconds (default: 5000)')
5152
.help()
5253

5354
cli

0 commit comments

Comments
 (0)
Please sign in to comment.