From f0d9460ca093494a5d6b694f075e9c23f585e293 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 17 Mar 2021 09:07:53 +1300 Subject: [PATCH] test(consistent-test-it): add case for `describe.only.each` --- .../__tests__/consistent-test-it.test.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/rules/__tests__/consistent-test-it.test.ts b/src/rules/__tests__/consistent-test-it.test.ts index 9fc950da3..028177b56 100644 --- a/src/rules/__tests__/consistent-test-it.test.ts +++ b/src/rules/__tests__/consistent-test-it.test.ts @@ -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") })',