Skip to content

Commit f0d9460

Browse files
committed
test(consistent-test-it): add case for describe.only.each
1 parent 10dd7c6 commit f0d9460

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/rules/__tests__/consistent-test-it.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,32 @@ ruleTester.run('consistent-test-it with fn=test', rule, {
213213
},
214214
],
215215
},
216+
{
217+
code: dedent`
218+
describe.only.each()("%s", () => {
219+
test("is valid, but should not be", () => {});
220+
221+
it("is not valid, but should be", () => {});
222+
});
223+
`,
224+
output: dedent`
225+
describe.only.each()("%s", () => {
226+
it("is valid, but should not be", () => {});
227+
228+
it("is not valid, but should be", () => {});
229+
});
230+
`,
231+
options: [{ fn: TestCaseName.test, withinDescribe: TestCaseName.it }],
232+
errors: [
233+
{
234+
messageId: 'consistentMethodWithinDescribe',
235+
data: {
236+
testKeywordWithinDescribe: TestCaseName.it,
237+
oppositeTestKeyword: TestCaseName.test,
238+
},
239+
},
240+
],
241+
},
216242
{
217243
code: 'describe("suite", () => { it("foo") })',
218244
output: 'describe("suite", () => { test("foo") })',

0 commit comments

Comments
 (0)