Skip to content

Commit cbaf1a9

Browse files
test: migrate test to eslint-vitest-rule-tester
1 parent 4bbe7ac commit cbaf1a9

File tree

133 files changed

+10617
-10493
lines changed

Some content is hidden

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

133 files changed

+10617
-10493
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
"$schema": "node_modules/knip/schema-jsonc.json",
33
"entry": ["src/index.ts!", "cz-adapter/index.js", "tests/**/*.test.ts"],
44
"project": ["src/**/*.ts!", "cz-adapter/**/*.{js,ts}", "tests/**/*.{js,ts}"],
5-
"ignore": ["tests/fixture/file.ts", "src/utils/conditional-imports/esm/**/*"],
5+
"ignore": ["src/utils/conditional-imports/esm/**/*"],
66
"ignoreDependencies": [
77
"@stylistic/eslint-plugin",
88
"@rebeccastevens/eslint-config",
99
"@types/eslint",
1010
"@typescript-eslint/eslint-plugin",
11-
"@vitest/coverage-istanbul",
1211
"@vitest/coverage-v8",
1312
"eslint-config-prettier",
1413
"eslint-flat-config-utils",

package.json

Lines changed: 4 additions & 5 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,7 +68,8 @@
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",
72+
"test-uncompiled": "vitest run --coverage",
7273
"test-work": "vitest",
7374
"test:js": "vitest --coverage",
7475
"type-check": "tsc -p tsconfig.build.json --noEmit",
@@ -100,8 +101,6 @@
100101
"@types/rollup-plugin-auto-external": "2.0.5",
101102
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.55",
102103
"@typescript-eslint/parser": "8.0.0-alpha.55",
103-
"@typescript-eslint/rule-tester": "8.0.0-alpha.55",
104-
"@vitest/coverage-istanbul": "2.0.4",
105104
"@vitest/coverage-v8": "2.0.4",
106105
"chalk": "4.1.2",
107106
"commitizen": "4.3.0",
@@ -132,8 +131,8 @@
132131
"eslint-plugin-unicorn": "55.0.0",
133132
"eslint-plugin-vitest": "0.5.4",
134133
"eslint-plugin-yml": "1.14.0",
135-
"espree": "10.1.0",
136134
"fast-glob": "3.3.2",
135+
"eslint-vitest-rule-tester": "0.3.3",
137136
"husky": "9.1.2",
138137
"jsonc-eslint-parser": "2.4.0",
139138
"knip": "5.27.0",

0 commit comments

Comments
 (0)