{"record":{"id":"e638b1c9cddc0465","repo":"oxc-project/oxc","slug":"call-to-pending","errorCode":null,"errorMessage":"Call to pending()","messagePattern":"Call to pending\\(\\)","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/shared/jest_vitest/no_disabled_tests.rs","lineNumber":51,"sourceCode":"describe['skip']('bar', () => {});\nit['skip']('bar', () => {});\ntest['skip']('bar', () => {});\n\nxdescribe('foo', () => {});\nxit('foo', () => {});\nxtest('foo', () => {});\n\nit('bar');\ntest('bar');\n\nit('foo', () => {\n  pending();\n});\n```\n\";\n\nfn no_disabled_tests_diagnostic(x1: &'static str, x2: &'static str, span3: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(x1).with_help(x2).with_label(span3)\n}\n\nenum Message {\n    MissingFunction,\n    Pending,\n    DisabledSuiteWithSkip,\n    DisabledSuiteWithX,\n    DisabledTestWithSkip,\n    DisabledTestWithX,\n}\n\nimpl Message {\n    pub fn details(&self) -> (&'static str, &'static str) {\n        match self {\n            Self::MissingFunction => (\"Test is missing function argument\", \"Add function argument\"),\n            Self::Pending => (\"Call to pending()\", \"Remove pending() call\"),\n            Self::DisabledSuiteWithSkip => (\"Disabled test suite\", \"Remove the appending `.skip`\"),\n            Self::DisabledSuiteWithX => (\"Disabled test suite\", \"Remove x prefix\"),","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/oxc-project/oxc/blob/a3d33dda7cb69da23db4fcaa2c0c05de61e760a1/crates/oxc_linter/src/rules/shared/jest_vitest/no_disabled_tests.rs#L33-L69","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the pending() call and either finish the test or convert it to it.todo('...')","If the function is genuinely skipped, use the explicit it.skip('name', fn) form so tooling can report it as skipped","Grep the repo for `pending()` during framework upgrades to catch all legacy call sites"],"exampleFix":"// before\nit('syncs data', function () {\n  pending();\n});\n\n// after\nit.todo('syncs data');","handlingStrategy":"validation","validationCode":"rg -n \"\\bpending\\(\\)\" tests/ # legacy Jasmine/Jest pending calls","typeGuard":null,"tryCatchPattern":null,"preventionTips":["During framework upgrades, sweep for pending(), xit, xtest and convert in one commit","Ban Jasmine globals explicitly in Jest config (injectGlobals off) so pending is not even defined","Use it.todo for unwritten tests instead of runtime pending()"],"tags":["jest","vitest","oxlint","testing","pending","legacy","jasmine"],"backgroundTag":"skipped-test","analyzedSha":"a3d33dda7cb69da23db4fcaa2c0c05de61e760a1","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}