Skip to content

Commit

Permalink
test: migrate test to eslint-vitest-rule-tester
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jul 11, 2024
1 parent 87bea37 commit bc88005
Show file tree
Hide file tree
Showing 132 changed files with 10,574 additions and 10,409 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ jobs:
- "20"
- "latest"
ts_version:
- "next"
# - "next"
- "latest"
- "4.7.4"
# - "4.7.4"
# - "JS"
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.ts_version == 'next' }}
env:
REPORT_COVERAGE: ${{ fromJSON('["false", "true"]')[matrix.node_version == 'latest' && matrix.os == 'ubuntu-latest'] }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
Expand All @@ -48,12 +46,16 @@ jobs:
if: matrix.ts_version != 'JS'
run: pnpm add -D typescript@"${{ matrix.ts_version }}"

# - name: Run Tests
# if: matrix.ts_version != 'latest'
# run: pnpm test-compiled # TODO: Figure out how to get proper coverage of this.

- name: Run Tests
run: pnpm test-compiled
if: matrix.ts_version == 'latest'
run: pnpm test-uncompiled

- name: Report coverage
uses: codecov/codecov-action@v4.1.1
if: env.REPORT_COVERAGE == 'true'
if: matrix.ts_version == 'latest' && matrix.node_version == 'latest'
with:
file: coverage/lcov.info
flags: ${{ matrix.ts_version }}
1 change: 1 addition & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@types/eslint",
"@typescript-eslint/eslint-plugin",
"@vitest/coverage-istanbul",
"@vitest/coverage-v8",
"eslint-config-prettier",
"eslint-flat-config-utils",
"eslint-import-resolver-typescript",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"files": ["lib/", "package.json", "LICENSE", "README.md"],
"scripts": {
"build": "pnpm run build:node && pnpm run build:docs",
"build-tests": "rimraf tests-compiled && tsc -p tsconfig.tests-compiled.json && tsc-alias -p tsconfig.tests-compiled.json",
"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",
"build:docs": "eslint-doc-generator",
"build:node": "rimraf lib && rollup -c rollup.config.ts --configPlugin rollup-plugin-ts",
"cz": "git-cz",
Expand All @@ -68,7 +68,8 @@
"prepare": "husky",
"release": "semantic-release",
"test": "pnpm run test:js",
"test-compiled": "USE_COMPILED_TESTS=1 vitest run --coverage",
"test-compiled": "USE_COMPILED_TESTS=1 vitest run",
"test-uncompiled": "vitest run --coverage",
"test-work": "vitest",
"test:js": "vitest --coverage",
"type-check": "tsc -p tsconfig.build.json --noEmit",
Expand Down Expand Up @@ -100,7 +101,6 @@
"@types/rollup-plugin-auto-external": "2.0.5",
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.41",
"@typescript-eslint/parser": "8.0.0-alpha.41",
"@typescript-eslint/rule-tester": "8.0.0-alpha.41",
"@vitest/coverage-istanbul": "2.0.2",
"@vitest/coverage-v8": "2.0.2",
"chalk": "4.1.2",
Expand All @@ -118,7 +118,7 @@
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-eslint-plugin": "6.2.0",
"eslint-plugin-format": "0.1.2",
"eslint-plugin-functional": "link:.",
"eslint-plugin-functional": "link:",
"eslint-plugin-import-x": "3.0.0",
"eslint-plugin-jsdoc": "48.7.0",
"eslint-plugin-jsonc": "2.16.0",
Expand All @@ -132,7 +132,7 @@
"eslint-plugin-unicorn": "54.0.0",
"eslint-plugin-vitest": "0.5.4",
"eslint-plugin-yml": "1.14.0",
"espree": "10.1.0",
"eslint-vitest-rule-tester": "0.3.2",
"husky": "9.0.11",
"jsonc-eslint-parser": "2.4.0",
"knip": "5.25.2",
Expand Down
54 changes: 26 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ deassert
declarator
declarators
deepmerge
espree
IIFE
jonaskello
Kello
Expand All @@ -19,3 +18,4 @@ rulesets
sonarjs
treeshake
TSES
uncompiled
Loading

0 comments on commit bc88005

Please sign in to comment.