Skip to content

Commit

Permalink
test(prefer-hooks-on-top): add cases for .each
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Apr 4, 2021
1 parent e113082 commit 484de05
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/rules/__tests__/prefer-hooks-on-top.test.ts
Expand Up @@ -45,6 +45,48 @@ ruleTester.run('basic describe block', rule, {
},
],
},
{
code: dedent`
describe('foo', () => {
beforeEach(() => {});
test.each\`\`('bar', () => {
someFn();
});
beforeAll(() => {});
test.only('bar', () => {
someFn();
});
});
`,
errors: [
{
messageId: 'noHookOnTop',
column: 3,
line: 6,
},
],
},
{
code: dedent`
describe('foo', () => {
beforeEach(() => {});
test.only.each\`\`('bar', () => {
someFn();
});
beforeAll(() => {});
test.only('bar', () => {
someFn();
});
});
`,
errors: [
{
messageId: 'noHookOnTop',
column: 3,
line: 6,
},
],
},
],
});

Expand Down

0 comments on commit 484de05

Please sign in to comment.