Skip to content

Commit 8cd6afd

Browse files
authored
Merge pull request #1765 from skaut/collector-vitest
[collector] Switched to vitest
2 parents efb038b + e5c7b0c commit 8cd6afd

19 files changed

+2146
-3646
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
6565
- name: "Run tests"
6666
run: |
67-
npm test
67+
npm run test-coverage
6868
6969
- name: "Upload coverage results"
7070
uses: codecov/[email protected]

packages/collector/__tests__/getProjectListing.test.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

packages/collector/__tests__/run.test.ts

Lines changed: 0 additions & 153 deletions
This file was deleted.

packages/collector/eslint.config.js

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import eslintComments from "@eslint-community/eslint-plugin-eslint-comments";
22
import commentsConfig from "@eslint-community/eslint-plugin-eslint-comments/configs";
33
import js from "@eslint/js";
4-
import jest from "eslint-plugin-jest";
4+
import vitest from "@vitest/eslint-plugin";
55
import perfectionist from "eslint-plugin-perfectionist";
66
import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
77
import prettierRecommended from "eslint-plugin-prettier/recommended";
@@ -25,7 +25,6 @@ export default tseslint.config(
2525
},
2626
plugins: {
2727
"eslint-comments": eslintComments,
28-
jest,
2928
"prefer-arrow-functions": preferArrowFunctions,
3029
},
3130
rules: {
@@ -143,41 +142,53 @@ export default tseslint.config(
143142
},
144143
},
145144
{
146-
...jest.configs["flat/recommended"],
147-
...jest.configs["flat/style"],
148-
files: ["__tests__/**/*.test.ts"],
145+
files: ["tests/**/*.test.ts"],
146+
...vitest.configs.recommended,
149147
rules: {
150-
...jest.configs["flat/recommended"].rules,
151-
...jest.configs["flat/style"].rules,
152-
"jest/consistent-test-it": ["error", { withinDescribe: "test" }],
153-
"jest/no-conditional-in-test": "error",
154-
"jest/no-confusing-set-timeout": "error",
155-
"jest/no-duplicate-hooks": "error",
156-
"jest/no-test-return-statement": "error",
157-
"jest/no-untyped-mock-factory": "error",
158-
"jest/padding-around-all": "error",
159-
"jest/prefer-called-with": "error",
160-
"jest/prefer-comparison-matcher": "error",
161-
"jest/prefer-each": "error",
162-
"jest/prefer-equality-matcher": "error",
163-
"jest/prefer-expect-assertions": [
148+
...vitest.configs.recommended.rules,
149+
"vitest/consistent-test-it": ["error", { withinDescribe: "test" }],
150+
"vitest/no-alias-methods": "error",
151+
"vitest/no-conditional-expect": "error",
152+
"vitest/no-conditional-in-test": "error",
153+
"vitest/no-conditional-tests": "error",
154+
"vitest/no-disabled-tests": "error",
155+
"vitest/no-duplicate-hooks": "error",
156+
"vitest/no-focused-tests": "error",
157+
"vitest/no-interpolation-in-snapshots": "error",
158+
"vitest/no-large-snapshots": "error",
159+
"vitest/no-mocks-import": "error",
160+
"vitest/no-standalone-expect": "error",
161+
"vitest/no-test-prefixes": "error",
162+
"vitest/no-test-return-statement": "error",
163+
"vitest/padding-around-all": "error",
164+
"vitest/prefer-called-with": "error",
165+
"vitest/prefer-comparison-matcher": "error",
166+
"vitest/prefer-each": "error",
167+
"vitest/prefer-equality-matcher": "error",
168+
"vitest/prefer-expect-assertions": [
164169
"error",
165170
{
166171
onlyFunctionsWithAsyncKeyword: true,
167172
onlyFunctionsWithExpectInCallback: true,
168173
onlyFunctionsWithExpectInLoop: true,
169174
},
170175
],
171-
"jest/prefer-expect-resolves": "error",
172-
"jest/prefer-hooks-in-order": "error",
173-
"jest/prefer-hooks-on-top": "error",
174-
"jest/prefer-jest-mocked": "error",
175-
"jest/prefer-mock-promise-shorthand": "error",
176-
"jest/prefer-spy-on": "error",
177-
"jest/prefer-strict-equal": "error",
178-
"jest/require-hook": "error",
179-
"jest/require-to-throw-message": "error",
180-
"jest/unbound-method": "error",
176+
"vitest/prefer-expect-resolves": "error",
177+
"vitest/prefer-hooks-in-order": "error",
178+
"vitest/prefer-hooks-on-top": "error",
179+
"vitest/prefer-mock-promise-shorthand": "error",
180+
"vitest/prefer-snapshot-hint": "error",
181+
"vitest/prefer-spy-on": "error",
182+
"vitest/prefer-strict-equal": "error",
183+
"vitest/prefer-to-be": "error",
184+
"vitest/prefer-to-be-object": "error",
185+
"vitest/prefer-to-contain": "error",
186+
"vitest/prefer-to-have-length": "error",
187+
"vitest/prefer-todo": "error",
188+
"vitest/prefer-vi-mocked": "error",
189+
"vitest/require-hook": "error",
190+
"vitest/require-to-throw-message": "error",
191+
"vitest/valid-expect-in-promise": "error",
181192
},
182193
},
183194
{

packages/collector/jest.config.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)