-
Notifications
You must be signed in to change notification settings - Fork 241
Closed
Description
Is there way to allow no-duplicate-hooks
allow to work with describe.each
, or is there recommended hook setup conforms those rules?
Interestingly, this doesn't error out for all describe.each but only if top-level describe includes subsequent nested describe.each.
repo: https://github.com/kwonoj/eslint-jest-duplicated-hooks
code:
describe('top', () => {
describe.each(['approve', 'decline'])('inner1', () => {
beforeEach(() => {
console.log('set');
});
it('renders correctly', () => {
expect(true).toBeTruthy();
});
});
describe.each(['approve', 'decline'])('inner2', () => {
beforeEach(() => {
console.log('set2');
});
it('renders correctly 2', () => {
expect(true).toBeTruthy
});
});
});
config:
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es2020": true,
"jest/globals": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 11
},
"plugins": [
"jest"
],
"rules": {
"jest/no-duplicate-hooks": "error"
}
};
jameson-athanasiou