Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: --test-timeout CLI argument #3019

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/config/index.md
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
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
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