Skip to content

Commit

Permalink
chore: fixed rule where skip didn't work (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
veritem authored Feb 19, 2023
1 parent 838f7ca commit 97a62c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/rules/no-skipped-tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { RuleTester } from '@typescript-eslint/utils/dist/ts-eslint'
import { it } from 'vitest'
import rule, { RULE_NAME } from './no-skipped-tests'

const valids = ['it("test", () => {});']
const valids = ['it("test", () => {});', 'test("test", () => {})']

const invalids = [
'test.skip("test", () => {});',
'it.skip("test", () => {});',
`describe.skip("math", () => {
it("works", () => {
Expand Down
10 changes: 5 additions & 5 deletions src/rules/no-skipped-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export default createEslintRule<Options, MessageIds>({
const { callee } = node.expression
if (
callee.type === 'MemberExpression' &&
callee.object.type === 'Identifier' &&
(callee.object.name === 'it' ||
callee.object.name === 'describe') &&
callee.property.type === 'Identifier' &&
callee.property.name === 'skip'
callee.object.type === 'Identifier' &&
(callee.object.name === 'it' ||
callee.object.name === 'describe' || callee.object.name === 'test') &&
callee.property.type === 'Identifier' &&
callee.property.name === 'skip'
) {
context.report({
node,
Expand Down

0 comments on commit 97a62c7

Please sign in to comment.