Summary
no-focused-tests, no-disabled-tests, and warn-todo currently detect chained Vitest modes such as:
test.only('focused test', () => {})
test.skip('skipped test', () => {})
test.todo('todo test')
However, Vitest also supports the same modes via the options object:
test('focused test', { only: true }, () => {})
test('skipped test', { skip: true }, () => {})
test('todo test', { todo: true })
These forms are currently not reported.
Reproduction
Add the following cases to the invalid section of each rule test file.
tests/no-focused-tests.test.ts
{
code: "test('focused test', { only: true }, () => {})",
errors: [{ messageId: 'noFocusedTests' }],
},
tests/no-disabled-tests.test.ts
{
code: "test('skipped test', { skip: true }, () => {})",
errors: [{ messageId: 'disabledTest' }],
},
tests/warn-todo.test.ts
{
code: "test('todo test', { todo: true })",
errors: [{ messageId: 'warnTodo' }],
},
Then run:
pnpm test tests/no-focused-tests.test.ts tests/no-disabled-tests.test.ts tests/warn-todo.test.ts
Currently, these cases fail.
Summary
no-focused-tests,no-disabled-tests, andwarn-todocurrently detect chained Vitest modes such as:However, Vitest also supports the same modes via the options object:
These forms are currently not reported.
Reproduction
Add the following cases to the
invalidsection of each rule test file.tests/no-focused-tests.test.tstests/no-disabled-tests.test.tstests/warn-todo.test.tsThen run:
Currently, these cases fail.