Skip to content

Commit

Permalink
test(consistent-test-it): add case for describe.only.each
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Apr 2, 2021
1 parent 10dd7c6 commit f0d9460
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/rules/__tests__/consistent-test-it.test.ts
Expand Up @@ -213,6 +213,32 @@ ruleTester.run('consistent-test-it with fn=test', rule, {
},
],
},
{
code: dedent`
describe.only.each()("%s", () => {
test("is valid, but should not be", () => {});
it("is not valid, but should be", () => {});
});
`,
output: dedent`
describe.only.each()("%s", () => {
it("is valid, but should not be", () => {});
it("is not valid, but should be", () => {});
});
`,
options: [{ fn: TestCaseName.test, withinDescribe: TestCaseName.it }],
errors: [
{
messageId: 'consistentMethodWithinDescribe',
data: {
testKeywordWithinDescribe: TestCaseName.it,
oppositeTestKeyword: TestCaseName.test,
},
},
],
},
{
code: 'describe("suite", () => { it("foo") })',
output: 'describe("suite", () => { test("foo") })',
Expand Down

0 comments on commit f0d9460

Please sign in to comment.