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 8afda35 commit 51e8e7f
Show file tree
Hide file tree
Showing 132 changed files with 10,048 additions and 10,482 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/[email protected]
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
8 changes: 4 additions & 4 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,8 +68,9 @@
"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-work": "vitest",
"test-uncompiled": "vitest run --coverage",
"test:js": "vitest --coverage",
"type-check": "tsc -p tsconfig.build.json --noEmit",
"verify": "pnpm run lint && pnpm run type-check && pnpm run build-tests && pnpm run test-compiled"
Expand Down Expand Up @@ -100,7 +101,6 @@
"@types/rollup-plugin-auto-external": "2.0.5",
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.39",
"@typescript-eslint/parser": "8.0.0-alpha.39",
"@typescript-eslint/rule-tester": "8.0.0-alpha.39",
"@vitest/coverage-istanbul": "1.6.0",
"@vitest/coverage-v8": "1.6.0",
"chalk": "4.1.2",
Expand Down Expand Up @@ -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.24.1",
Expand Down
Loading

0 comments on commit 51e8e7f

Please sign in to comment.