oxc-project/oxc · warning · OxcDiagnostic

Call to pending()

Error message

Call to pending()

What it means

The Message::Pending diagnostic of oxlint rule `jest/no-disabled-tests` (shared with vitest), defined via the shared constructor at no_disabled_tests.rs:59. It fires on a bare call to the global `pending()` function inside a test, the legacy Jasmine-style way of marking a test unfinished. Because pending() silently disables the rest of the test, the rule asks you to remove it.

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

  1. Remove the pending() call and either finish the test or convert it to it.todo('...')
  2. If the function is genuinely skipped, use the explicit it.skip('name', fn) form so tooling can report it as skipped
  3. Grep the repo for `pending()` during framework upgrades to catch all legacy call sites

Example fix

// before
it('syncs data', function () {
  pending();
});

// after
it.todo('syncs data');
Defensive patterns

Strategy: validation

Validate before calling

rg -n "\bpending\(\)" tests/ # legacy Jasmine/Jest pending calls

Prevention

When it happens

Trigger: The fallback branch at no_disabled_tests.rs:83-90: a call expression whose callee is the identifier `pending` that resolves to a global variable (not a local import), e.g. `it('foo', () => { pending(); ... })`. Local helpers named pending that shadow the global do not trigger it.

Common situations: Tests migrated from Jasmine or very old Jest codebases; developers marking work-in-progress with pending(); copy-paste from legacy tutorials; partial upgrade where only some tests were modernized.

Related errors


AI-assisted analysis of oxc-project/oxc@a3d33dda7c (2026-08-20). Data as JSON: /api/errors/e638b1c9cddc0465. Report an issue: GitHub.