From 6bc2576094808490b4140f78578603934c35e6db Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Tue, 27 Feb 2024 16:34:01 -0600 Subject: [PATCH] test: Add more test cases test configuration --- src/rules/expect-expect.test.ts | 19 +++++++++++++++++++ src/rules/require-top-level-describe.test.ts | 17 +++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/rules/expect-expect.test.ts b/src/rules/expect-expect.test.ts index 39bc263..82efba9 100644 --- a/src/rules/expect-expect.test.ts +++ b/src/rules/expect-expect.test.ts @@ -46,6 +46,25 @@ runRuleTester('expect-expect', rule, { '["bar"]();', 'testing("will test something eventually", () => {})', 'test("should pass", () => expect(true).toBeDefined())', + 'test.slow("should pass", () => expect(true).toBeDefined())', + 'test.skip("should pass", () => expect(true).toBeDefined())', + // Config methods + 'test.describe.configure({ mode: "parallel" })', + 'test.info()', + 'test.use({ locale: "en-US" })', + // test.skip + 'test.skip();', + 'test.skip(true);', + 'test.skip(browserName === "Chrome", "This feature is skipped on Chrome")', + 'test.skip(({ browserName }) => browserName === "Chrome");', + 'test.skip("foo", () => { expect(true).toBeDefined(); })', + // test.slow + 'test.slow();', + 'test.slow(true);', + 'test.slow(browserName === "webkit", "This feature is slow on Mac")', + 'test.slow(({ browserName }) => browserName === "Chrome");', + 'test.slow("foo", () => { expect(true).toBeDefined(); })', + // test.step { code: dedent` test('steps', async ({ page }) => { diff --git a/src/rules/require-top-level-describe.test.ts b/src/rules/require-top-level-describe.test.ts index d2afa06..70c100c 100644 --- a/src/rules/require-top-level-describe.test.ts +++ b/src/rules/require-top-level-describe.test.ts @@ -178,16 +178,13 @@ runRuleTester('require-top-level-describe', rule, { 'foo()', 'test.info()', 'test.use({ locale: "en-US" })', - // 'test.only("that all is as it should be", () => {});', - // 'test.skip("that all is as it should be", () => {});', - // 'test.skip(({ browserName }) => browserName === "Chrome");', - // 'test.skip();', - // 'test.skip(true);', - // 'test.skip(browserName === "Chrome", "This feature is skipped on Chrome")', - // 'test.slow("that all is as it should be", () => {});', - // 'test.slow(({ browserName }) => browserName === "Chrome");', - // 'test.slow();', - // 'test.slow(browserName === "webkit", "This feature is slow on Mac")', + 'test.skip(({ browserName }) => browserName === "Chrome");', + 'test.skip();', + 'test.skip(true);', + 'test.skip(browserName === "Chrome", "This feature is skipped on Chrome")', + 'test.slow(({ browserName }) => browserName === "Chrome");', + 'test.slow();', + 'test.slow(browserName === "webkit", "This feature is slow on Mac")', 'test.describe.configure({ mode: "parallel" })', 'test.describe("suite", () => { test("foo") });', 'test.describe.only("suite", () => { test.beforeAll("my beforeAll") });',