Thanks for all the hard work on this incredibly useful plugin!
It looks like describe.each() and it.each() aren't handled and trigger the no-setup-in-describe rule when they shouldn't
Plain describe() and it() behave as expected (i.e. don't trigger no-setup-in-describe.
Some examples:
import expect from 'expect';
// this triggers no-setup-in-describe
describe.each([['a'], ['b']])('letter %s', letter => {
it('does something with the letter', () => {
// meaningless test so that example is runnable
expect(letter).toEqual(letter);
});
});
describe('fruit', () => {
// this also triggers no-setup-in-describe
it.each([['apples'], ['oranges']])('eats %s', fruit => {
expect(eats(fruit)).toBe(true);
});
});
🤔 Mocha doesn’t have describe.each() or it.each(), so I think you need to specify additionalCustomNames so the rule knows about it and treats it as a describe or it block, see here.
Thanks for all the hard work on this incredibly useful plugin!
It looks like
describe.each()
andit.each()
aren't handled and trigger theno-setup-in-describe
rule when they shouldn't Plaindescribe()
andit()
behave as expected (i.e. don't triggerno-setup-in-describe
.Some examples:
package.json dependencies:
Could it be a similar problem to this? https://github.com/lo1tuma/eslint-plugin-mocha/issues/249