Skip to content

Commit 07e1b7e

Browse files
test: migrate test to eslint-vitest-rule-tester
1 parent 9a104aa commit 07e1b7e

File tree

144 files changed

+10403
-10945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+10403
-10945
lines changed

.github/workflows/test-js.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ jobs:
1818
- "20"
1919
- "latest"
2020
ts_version:
21-
- "next"
21+
# - "next"
2222
- "latest"
23-
- "4.7.4"
23+
# - "4.7.4"
2424
# - "JS"
2525
runs-on: ${{ matrix.os }}
2626
continue-on-error: ${{ matrix.ts_version == 'next' }}
27-
env:
28-
REPORT_COVERAGE: ${{ fromJSON('["false", "true"]')[matrix.node_version == 'latest' && matrix.os == 'ubuntu-latest'] }}
2927
steps:
3028
- uses: actions/checkout@v4
3129
- uses: ./.github/actions/prepare
@@ -48,12 +46,16 @@ jobs:
4846
if: matrix.ts_version != 'JS'
4947
run: pnpm add -D typescript@"${{ matrix.ts_version }}"
5048

49+
# - name: Run Tests
50+
# if: matrix.ts_version != 'latest'
51+
# run: pnpm test-compiled # TODO: Figure out how to get proper coverage of this.
52+
5153
- name: Run Tests
52-
run: pnpm test-compiled
54+
if: matrix.ts_version == 'latest'
55+
run: pnpm test-uncompiled
5356

5457
- name: Report coverage
5558
uses: codecov/codecov-action@v4.1.1
56-
if: env.REPORT_COVERAGE == 'true'
59+
if: matrix.ts_version == 'latest' && matrix.node_version == 'latest'
5760
with:
5861
file: coverage/lcov.info
59-
flags: ${{ matrix.ts_version }}

knip.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"@types/eslint",
1010
"@typescript-eslint/eslint-plugin",
1111
"@vitest/coverage-istanbul",
12+
"@vitest/coverage-v8",
1213
"eslint-config-prettier",
1314
"eslint-flat-config-utils",
1415
"eslint-import-resolver-typescript",

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"files": ["lib/", "package.json", "LICENSE", "README.md"],
4444
"scripts": {
4545
"build": "pnpm run build:node && pnpm run build:docs",
46-
"build-tests": "rimraf tests-compiled && tsc -p tsconfig.tests-compiled.json && tsc-alias -p tsconfig.tests-compiled.json",
46+
"build-tests": "rimraf tests-compiled && tsc -p tsconfig.tests-compiled.json && tsc-alias -p tsconfig.tests-compiled.json && cp tests/tsconfig.test.json tests-compiled/tests/tsconfig.test.json",
4747
"build:docs": "eslint-doc-generator",
4848
"build:node": "rimraf lib && rollup -c rollup.config.ts --configPlugin rollup-plugin-ts",
4949
"cz": "git-cz",
@@ -68,8 +68,9 @@
6868
"prepare": "husky",
6969
"release": "semantic-release",
7070
"test": "pnpm run test:js",
71-
"test-compiled": "USE_COMPILED_TESTS=1 vitest run --coverage",
71+
"test-compiled": "USE_COMPILED_TESTS=1 vitest run",
7272
"test-work": "vitest",
73+
"test-uncompiled": "vitest run --coverage",
7374
"test:js": "vitest --coverage",
7475
"type-check": "tsc -p tsconfig.build.json --noEmit",
7576
"verify": "pnpm run lint && pnpm run type-check && pnpm run build-tests && pnpm run test-compiled"
@@ -101,7 +102,6 @@
101102
"@types/rollup-plugin-auto-external": "2.0.5",
102103
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.39",
103104
"@typescript-eslint/parser": "8.0.0-alpha.39",
104-
"@typescript-eslint/rule-tester": "8.0.0-alpha.39",
105105
"@vitest/coverage-istanbul": "1.6.0",
106106
"@vitest/coverage-v8": "1.6.0",
107107
"chalk": "4.1.2",
@@ -133,7 +133,7 @@
133133
"eslint-plugin-unicorn": "54.0.0",
134134
"eslint-plugin-vitest": "0.5.4",
135135
"eslint-plugin-yml": "1.14.0",
136-
"espree": "10.1.0",
136+
"eslint-vitest-rule-tester": "0.3.2",
137137
"husky": "9.0.11",
138138
"jsonc-eslint-parser": "2.4.0",
139139
"knip": "5.24.1",

0 commit comments

Comments
 (0)