Skip to content

Commit

Permalink
test: Add more test cases test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Feb 27, 2024
1 parent 91988d5 commit 6bc2576
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
19 changes: 19 additions & 0 deletions src/rules/expect-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
17 changes: 7 additions & 10 deletions src/rules/require-top-level-describe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") });',
Expand Down

0 comments on commit 6bc2576

Please sign in to comment.