Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.08 KB

no-focused-test.md

File metadata and controls

43 lines (33 loc) · 1.08 KB

Disallow usage of .only annotation (no-focused-test)

Examples of incorrect code for this rule:

test.only('focus this test', async ({ page }) => {})

test.describe.only('focus two tests', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})

test.describe.parallel.only('focus two tests in parallel mode', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})

test.describe.serial.only('focus two tests in serial mode', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})

Examples of correct code for this rule:

test('this test', async ({ page }) => {})

test.describe('two tests', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})

test.describe.parallel('two tests in parallel mode', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})

test.describe.serial('two tests in serial mode', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})