oxc-project/oxc · warning · OxcDiagnostic
Disabled test
Error message
Disabled test
What it means
The `Disabled test` diagnostic of oxlint rule `jest/no-disabled-tests` (shared with vitest), produced by Message::DisabledTestWithSkip and Message::DisabledTestWithX. It fires when an individual test case is disabled: `it.skip(...)` / `test.skip(...)` (help: remove the appending `.skip`) or the prefix forms `xit(...)` / `xtest(...)` (help: remove x prefix).
Source
Thrown at crates/oxc_linter/src/rules/shared/jest_vitest/no_disabled_tests.rs:51
describe['skip']('bar', () => {});
it['skip']('bar', () => {});
test['skip']('bar', () => {});
xdescribe('foo', () => {});
xit('foo', () => {});
xtest('foo', () => {});
it('bar');
test('bar');
it('foo', () => {
pending();
});
```
";
fn no_disabled_tests_diagnostic(x1: &'static str, x2: &'static str, span3: Span) -> OxcDiagnostic {
OxcDiagnostic::warn(x1).with_help(x2).with_label(span3)
}
enum Message {
MissingFunction,
Pending,
DisabledSuiteWithSkip,
DisabledSuiteWithX,
DisabledTestWithSkip,
DisabledTestWithX,
}
impl Message {
pub fn details(&self) -> (&'static str, &'static str) {
match self {
Self::MissingFunction => ("Test is missing function argument", "Add function argument"),
Self::Pending => ("Call to pending()", "Remove pending() call"),
Self::DisabledSuiteWithSkip => ("Disabled test suite", "Remove the appending `.skip`"),
Self::DisabledSuiteWithX => ("Disabled test suite", "Remove x prefix"),View on GitHub (pinned to a3d33dda7c)
Solutions
- Remove `.skip` / the `x` prefix and fix the test so it runs green
- If the case is planned but unwritten, replace with test.todo('name') so it shows up as todo, not silently skipped
- Audit skips at release time: rg -n '\b(xit|xtest)\b|\b(it|test)\.skip\(' tests/ and require justification for each
Example fix
// before
it.skip('handles timeout', fn);
xtest('legacy shape', fn);
// after
it('handles timeout', fn);
test.todo('legacy shape'); Defensive patterns
Strategy: validation
Validate before calling
rg -n "\b(?:xit|xtest)\b|\b(?:it|test)\.skip\(" tests/ && exit 1 || exit 0 # fail on disabled tests Prevention
- Make the CI grep above non-fatal only for a tracked allowlist file
- Prefer test.todo over it.skip for unwritten work
- Attach an issue link to every intentional skip so cleanup is schedulable
When it happens
Trigger: From no_disabled_tests.rs:112-133: a general jest call of kind Test whose name starts with `x` (xit, xtest) or whose members include `skip` (it.skip, test.skip). The diagnostic spans the callee.
Common situations: Temporarily skipping a red test during a big refactor; committing `it.skip` while debugging and forgetting; suites where xtest came from copied legacy code; enabling the jest category in oxlint and discovering accumulated skips.
Related errors
- Disabled test suite
- Matchers must be called to assert.
- Expect has an unknown modifier.
- Async assertions must be awaited.
- Promises which return async assertions must be awaited.
AI-assisted analysis of oxc-project/oxc@a3d33dda7c (2026-08-20).
Data as JSON: /api/errors/c120d010777378bd.
Report an issue: GitHub.