{"record":{"id":"fee034d8943780e1","repo":"jestjs/jest","slug":"jest-failing-tests-are-only-supported-in-jest","errorCode":null,"errorMessage":"Jest: `failing` tests are only supported in `jest-circus`.","messagePattern":"Jest: `failing` tests are only supported in `jest-circus`\\.","errorType":"exception","errorClass":"ErrorWithStack","httpStatus":null,"severity":"error","filePath":"packages/jest-jasmine2/src/index.ts","lineNumber":209,"sourceCode":"        // @ts-expect-error: `it` is `void` for some reason\n        it.result.__callsite = stack;\n\n        return it;\n      };\n      return wrapped as any as T;\n    }\n\n    environment.global.it = wrapIt(environment.global.it);\n    environment.global.xit = wrapIt(environment.global.xit);\n    environment.global.fit = wrapIt(environment.global.fit);\n  }\n\n  jasmineAsyncInstall(globalConfig, environment.global);\n\n  installEach(environment);\n\n  const failing = () => {\n    throw new ErrorWithStack(\n      'Jest: `failing` tests are only supported in `jest-circus`.',\n      failing,\n    );\n  };\n\n  failing.each = () => {\n    throw new ErrorWithStack(\n      'Jest: `failing` tests are only supported in `jest-circus`.',\n      failing.each,\n    );\n  };\n\n  environment.global.it.failing = failing;\n  environment.global.fit.failing = failing;\n  environment.global.xit.failing = failing;\n\n  environment.global.test = environment.global.it;\n  environment.global.it.only = environment.global.fit;","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/jestjs/jest/blob/8e6d128e4a278059ecddecaa97400b04c8ae5fd9/packages/jest-jasmine2/src/index.ts#L191-L227","documentation":"The `failing` marker on a test (e.g. `it.failing(...)`) is a jest-circus-only feature that inverts pass/fail. Under the jasmine2 test runner, jest-jasmine2 stubs `it.failing` / `fit.failing` / `xit.failing` with a function that always throws an ErrorWithStack pointing to the call site. This prevents silent misbehavior where a 'failing' test appears to pass.","triggerScenarios":"Calling `it.failing('...', () => {...})` (or `test.failing`) in a test file while the project uses `testRunner: 'jest-jasmine2'`. The stub at index.ts:208-213 is assigned to `environment.global.it.failing` at line 222 and throws on invocation.","commonSituations":"Copying a test that uses `it.failing` from a circus-based project into a jasmine2 project; an old Jest config still pinned to jasmine2; a dependency's test suite uses `failing` but the consuming project runs jasmine2.","solutions":["Switch the test runner to jest-circus (the Jest default since v27): remove `testRunner: 'jest-jasmine2'` from config.","If you must stay on jasmine2, replace `it.failing(...)` with `it(...)` and use `expect().toBe()` assertions that you expect to fail, or remove the test.","Update to a Jest version where circus is the only bundled runner (Jest 28+)."],"exampleFix":"// before (jasmine2 runner)\nit.failing('should fail', () => { expect(1).toBe(2); });\n// after — switch to circus in jest.config.js\nmodule.exports = { testRunner: 'jest-circus' }; // or omit; it's the default","handlingStrategy":"validation","validationCode":"// Detect failing-test usage and warn if running under jasmine2.\nconst isCircus = require('jest-circus') != null; // or check config.testRunner\nif (!isCircus) {\n  // scan test files for '.failing' usage\n  console.warn('it.failing is not supported under jasmine2 — switch to jest-circus.');\n}","typeGuard":"function isJasmineRunner(config: { testRunner?: string }): boolean {\n  return (config.testRunner ?? '').includes('jasmine2');\n}","tryCatchPattern":null,"preventionTips":["Default to jest-circus (omit testRunner or set 'jest-circus').","Codemod `it.failing` usages out if you must stay on jasmine2.","Document the runner requirement next to any `it.failing` test."],"tags":["test-runner","jest-circus","jasmine2","api-mismatch","configuration"],"backgroundTag":null,"analyzedSha":"8e6d128e4a278059ecddecaa97400b04c8ae5fd9","analyzedAt":"2026-08-10T18:11:27.960Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}