Skip to content

Commit

Permalink
feat: --test-timeout CLI argument
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Mar 18, 2023
1 parent d4d0425 commit 1ac80af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ This can improve performance in some cases, but might cause segfault in older No

- **Type:** `number`
- **Default:** `5000`
- **CLI:** `--test-timeout=5000`

Default timeout of a test in milliseconds

Expand Down
4 changes: 4 additions & 0 deletions docs/guide/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: Debugging | Guide

# Debugging

:::tip
When debugging tests you might want to use `--test-timeout` CLI argument to prevent tests from timing out when stopping at breakpoints.
:::

## VSCode

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*
Expand Down
1 change: 1 addition & 0 deletions packages/vitest/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ cli
.option('--no-color', 'Removes colors from the console output')
.option('--inspect', 'Enable Node.js inspector')
.option('--inspect-brk', 'Enable Node.js inspector with break')
.option('--test-timeout <time>', 'Default timeout of a test in milliseconds (default: 5000)')
.help()

cli
Expand Down

0 comments on commit 1ac80af

Please sign in to comment.