Skip to content

Commit

Permalink
Add vitest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 committed Jan 23, 2024
1 parent a4bccb9 commit 5c1a3f3
Show file tree
Hide file tree
Showing 3 changed files with 344 additions and 3 deletions.
4 changes: 3 additions & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"prepare": "pnpm build",
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest",
"lint": "eslint . --ext .ts",
"prettier": "prettier --check packages",
"prettier-fix": "prettier --write packages",
Expand Down Expand Up @@ -60,6 +61,7 @@
"@typescript-eslint/parser": "^6.19.1",
"@typescript-eslint/rule-tester": "^6.19.1",
"eslint": "^8.56.0",
"prettier": "^3.2.4"
"prettier": "^3.2.4",
"vitest": "^1.2.1"
}
}
7 changes: 7 additions & 0 deletions plugin/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { RuleTester, type RuleTesterConfig } from '@typescript-eslint/rule-tester'
import * as vitest from 'vitest'

RuleTester.afterAll = vitest.afterAll

RuleTester.it = vitest.it
RuleTester.itOnly = vitest.it.only
RuleTester.describe = vitest.describe

const baseTesterConfig: RuleTesterConfig = {
parser: '@typescript-eslint/parser',
Expand Down
Loading

0 comments on commit 5c1a3f3

Please sign in to comment.