-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
severest/retrobot
#25Description
Thanks for this great plugin!
A mistake I've seen some people make is using an async function for describe, which then makes jest fail silently for a case like the following:
describe('sample case', () => {
it('works', () => {
expect(true).toEqual(true);
});
describe('async', async () => {
await new Promise(setImmediate);
it('breaks', () => {
throw new Error('Fail');
});
});
});It would be nice to have a rule that prevents this. Same would go for returning a promise (or any other value) inside describe.
describe('sample case', () => {
it('works', () => {
expect(true).toEqual(true);
});
describe('async', () => {
return Promise.resolve().then(() => {
it('breaks', () => {
throw new Error('Fail');
});
});
});
});What do you guys think?