Skip to content

Commit e900f68

Browse files
test: migrate test to eslint-vitest-rule-tester
1 parent 68910ea commit e900f68

File tree

132 files changed

+10584
-10466
lines changed

Some content is hidden

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

132 files changed

+10584
-10466
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
@@ -39,7 +39,7 @@
3939
"files": ["lib/", "package.json", "LICENSE", "README.md"],
4040
"scripts": {
4141
"build": "pnpm run build:node && pnpm run build:docs",
42-
"build-tests": "rimraf tests-compiled && tsc -p tsconfig.tests-compiled.json && tsc-alias -p tsconfig.tests-compiled.json",
42+
"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",
4343
"build:docs": "eslint-doc-generator",
4444
"build:node": "rimraf lib && rollup -c rollup.config.ts --configPlugin rollup-plugin-ts",
4545
"cz": "git-cz",
@@ -64,7 +64,8 @@
6464
"prepare": "husky",
6565
"release": "semantic-release",
6666
"test": "pnpm run test:js",
67-
"test-compiled": "USE_COMPILED_TESTS=1 vitest run --coverage",
67+
"test-compiled": "USE_COMPILED_TESTS=1 vitest run",
68+
"test-uncompiled": "vitest run --coverage",
6869
"test-work": "vitest",
6970
"test:js": "vitest --coverage",
7071
"type-check": "tsc -p tsconfig.build.json --noEmit",
@@ -95,8 +96,6 @@
9596
"@types/node": "18.18.0",
9697
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.60",
9798
"@typescript-eslint/parser": "8.0.0-alpha.60",
98-
"@typescript-eslint/rule-tester": "8.0.0-alpha.60",
99-
"@vitest/coverage-istanbul": "2.0.5",
10099
"@vitest/coverage-v8": "2.0.5",
101100
"chalk": "4.1.2",
102101
"commitizen": "4.3.0",
@@ -127,8 +126,8 @@
127126
"eslint-plugin-unicorn": "55.0.0",
128127
"eslint-plugin-vitest": "0.5.4",
129128
"eslint-plugin-yml": "1.14.0",
130-
"espree": "10.1.0",
131129
"fast-glob": "3.3.2",
130+
"eslint-vitest-rule-tester": "0.3.3",
132131
"husky": "9.1.4",
133132
"jsonc-eslint-parser": "2.4.0",
134133
"knip": "5.27.0",

pnpm-lock.yaml

Lines changed: 33 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

project-dictionary.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ deassert
33
declarator
44
declarators
55
deepmerge
6-
espree
76
IIFE
87
jonaskello
98
Kello
@@ -19,3 +18,4 @@ rulesets
1918
sonarjs
2019
treeshake
2120
TSES
21+
uncompiled

0 commit comments

Comments
 (0)