jestjs/jest · error · Error
Jest: `failing` tests are only supported in `jest-circus`.
Error message
Jest: `failing` tests are only supported in `jest-circus`.
What it means
Thrown by `concurrentFn.failing` in jasmineAsyncInstall.ts:237. `failing` is a jest-circus-only API for tests that are expected to fail; jasmine2 does not implement it, so invoking `it.concurrent.failing(...)` throws immediately at registration time.
Source
Thrown at packages/jest-jasmine2/src/jasmineAsyncInstall.ts:237
}
throw new Error(
`Jest: concurrent test "${spec.getFullName()}" must return a Promise.`,
);
});
} catch (error) {
promise = Promise.reject(error);
}
// Avoid triggering the uncaught promise rejection handler in case the test errors before
// being awaited on.
// eslint-disable-next-line @typescript-eslint/no-empty-function
promise.catch(() => {});
return spec;
};
// eslint-disable-next-line unicorn/consistent-function-scoping
const failing = () => {
throw new Error(
'Jest: `failing` tests are only supported in `jest-circus`.',
);
};
failing.each = () => {
throw new Error(
'Jest: `failing` tests are only supported in `jest-circus`.',
);
};
// each is bound after the function is made concurrent, so for now it is made noop
// eslint-disable-next-line @typescript-eslint/no-empty-function,unicorn/consistent-function-scoping
concurrentFn.each = () => () => {};
concurrentFn.failing = failing;
return concurrentFn;
}
export default function jasmineAsyncInstall(View on GitHub (pinned to f49721c78e)
Solutions
- Switch the project to jest-circus: set `testRunner: 'jest-circus'` in config (default in Jest 27+; upgrade if older).
- If you must stay on jasmine2, remove the `.failing` call and invert the assertion manually instead.
Example fix
// before (with jasmine2 runner)
it.concurrent.failing('known bug', async () => { expect(buggy()).toBe(true); });
// after
// jest.config.js: testRunner: 'jest-circus' Defensive patterns
Strategy: validation
Validate before calling
const config = require('./jest.config');
if (config.testRunner && !config.testRunner.includes('circus')) {
throw new Error('it.concurrent.failing requires jest-circus');
} Prevention
- Set `testRunner: 'jest-circus'` (default in Jest 27+) before using .failing.
- Gate circus-only APIs behind a runner check in shared test helpers.
When it happens
Trigger: Calling `it.concurrent.failing('x', fn)` or `test.concurrent.failing(...)` in a project whose test runner is `jasmine2` (the default before Jest 27, or when `testRunner` points at `jasmine2`).
Common situations: Copying a test from a circus-based project into a jasmine2 project; Jest version downgrade; default runner still jasmine2 in an older config.
Related errors
- Jest: `failing` tests are only supported in `jest-circus`.
- Jest: concurrent test "${specFullName}" must return a Promis
- Returning a Promise from "describe" is not supported. Tests
- A "describe" callback must not return a value.
- Todo must be called with only a description.
AI-assisted analysis of jestjs/jest@f49721c78e (2026-08-03).
Data as JSON: /data/errors/68d7898c8d3d2fc5.json.
Report an issue: GitHub.