Skip to content

allowConditional: true does not error on non-conditional calls #353

Open
@seanlafferty-ibm

Description

@seanlafferty-ibm

Hi, these rules have an allowConditional option

I interpreted the documentation to mean that this:

{
  "playwright/no-skipped-test": [
    "error",
    {
      "allowConditional": true
    }
  ]
}

makes .skip() disallowed unless a condition is provided, eg

test('foo', ({ browserName }) => {
  test.skip(browserName === 'firefox', 'Still working on it') // pass
})

test('foo', ({ browserName }) => {
  test.skip() // fail
})

However, the behavior I am seeing is

test('foo', ({ browserName }) => {
  test.skip(browserName === 'firefox', 'Still working on it') // pass
})

test('foo', ({ browserName }) => {
  test.skip() // pass
})

Using 2.2.0. Do I misunderstand the docs? As in, does "allowConditional": true just mean that chaining .skip in the original test() call is prohibited, but any variation of test.skip() within the body of the test is allowed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions