Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support all variations of describe, it, & test #792

Merged
merged 11 commits into from
Apr 5, 2021
Prev Previous commit
Next Next commit
test(consistent-test-it): add case for describe.only.each
  • Loading branch information
G-Rath committed Apr 4, 2021
commit fe4374481ea624ed1f4a7d23bcf6c5610d1fd9df
26 changes: 26 additions & 0 deletions src/rules/__tests__/consistent-test-it.test.ts
Original file line number Diff line number Diff line change
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