oxc-project/oxc · error · OxcDiagnostic
`vi.setConfig()` is missing a `testTimeout` property.
Error message
`vi.setConfig()` is missing a `testTimeout` property.
What it means
Emitted by the vitest/require-test-timeout rule at a `vi.setConfig()` call whose configuration object lacks a `testTimeout` property. It fires because the rule requires every config call to establish an explicit test timeout rather than silently keeping the default.
Source
Thrown at crates/oxc_linter/src/rules/vitest/require_test_timeout.rs:28
context::LintContext,
rule::Rule,
rules::PossibleJestNode,
utils::{
JestFnKind, JestGeneralFnKind, KnownMemberExpressionProperty,
collect_possible_jest_call_node, parse_general_jest_fn_call,
},
};
fn test_missing_timeout(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Test is missing a timeout.")
.with_help(
"Add a numeric third argument, a `{ timeout }` option object second argument, or call `vi.setConfig({ testTimeout: ... })` before this test.",
)
.with_label(span)
}
fn config_missing_timeout_object(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("`vi.setConfig()` is missing a `testTimeout` property.")
.with_help("Pass an object with a `testTimeout` property to `vi.setConfig()`.")
.with_label(span)
}
fn test_options_missing_timeout_property(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Test options object is missing a `timeout` property.")
.with_help("Add a `timeout` property to the options object.")
.with_label(span)
}
fn timeout_must_be_a_number(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Timeout must be a number.")
.with_help("Use a non-negative numeric literal for the timeout value.")
.with_label(span)
}
fn timeout_must_be_non_negative(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("Timeout must not be negative.")View on GitHub (pinned to e1e7af627c)
Solutions
- Add a `testTimeout` property to the object passed to `vi.setConfig()`, e.g. `vi.setConfig({ testTimeout: 5000 })`
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/oxc_linter/src/rules/vitest/require_test_timeout.rs:28 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20).
Data as JSON: /api/errors/db27566cdde9fd69.
Report an issue: GitHub.