jest/valid-describe-callback
eslint-plugin-jest
No autofixRecommended
eslint.config.js
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/valid-describe-callback": "error",
},
},
];// Async callback functions are not allowed
describe('myFunction()', async () => {
// ...
});
// Callback function parameters are not allowed
describe('myFunction()', done => {
// ...
});
// Returning a value from a describe block is not allowed
describe('myFunction', () =>
it('returns a truthy value', () => {
expect(myFunction()).toBeTruthy();
}));The documentation shows no correct example for this rule.
Examples from the Oxlint documentation.
jest/valid-describe-callback
eslint-plugin-jest
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/valid-describe-callback": "error",
},
},
];jest/valid-describe-callback
jest plugin · correctness
{
"plugins": [
"jest"
],
"rules": {
"jest/valid-describe-callback": "error"
}
}Biome does not have this rule.
Require promises that have expectations in their chain to be valid
Disallow string interpolation inside snapshots
Disallow use of deprecated functions