Repository URL to install this package:
|
Version:
0.6.0 ▾
|
gateway-proxy
/
usr
/
share
/
gateway-proxy
/
app
/
node_modules
/
eslint-plugin-jest
/
docs
/
rules
/
valid-describe-callback.md
|
|---|
describe() callback (valid-describe-callback)💼 This rule is enabled in the following
configs:
all, recommended.
Using an improper describe() callback function can lead to unexpected test
errors.
This rule validates that the second parameter of a describe() function is a
callback function. This callback function:
return statementsThe following describe function aliases are also validated:
describedescribe.onlydescribe.skipfdescribexdescribeThe following patterns are considered warnings:
// Async callback functions are not allowed describe('myFunction()', async () => { // ... }); // Callback function parameters are not allowed describe('myFunction()', done => { // ... }); // describe('myFunction', () => { // No return statements are allowed in block of a callback function return Promise.resolve().then(() => { it('breaks', () => { throw new Error('Fail'); }); }); }); // Returning a value from a describe block is not allowed describe('myFunction', () => it('returns a truthy value', () => { expect(myFunction()).toBeTruthy(); }));
The following patterns are not considered warnings:
describe('myFunction()', () => { it('returns a truthy value', () => { expect(myFunction()).toBeTruthy(); }); });