Skip to content

Commit 8e3388b

Browse files
committed
Successfully migrate to vitest
eh update lockfile eh eh
1 parent 3294bd3 commit 8e3388b

File tree

7 files changed

+918
-1451
lines changed

7 files changed

+918
-1451
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
cache: 'pnpm'
4646

4747
- run: pnpm install
48-
- run: pnpm test:coverage --runInBand
48+
- run: pnpm test:coverage

eslint.config.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const js = require('@eslint/js');
55
const babelEslintParser = require('@babel/eslint-parser');
66
const eslintPluginEslintPluginAll = require('eslint-plugin-eslint-plugin/configs/all');
77
const eslintPluginFilenames = require('eslint-plugin-filenames');
8-
const eslintPluginJest = require('eslint-plugin-jest');
98
const eslintPluginMarkdown = require('eslint-plugin-markdown');
109
const eslintPluginN = require('eslint-plugin-n');
1110
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
@@ -168,29 +167,7 @@ module.exports = [
168167
{
169168
// Test files:
170169
files: ['**/*.js', '**/*.js.snap'],
171-
plugins: { jest: eslintPluginJest },
172-
rules: {
173-
...eslintPluginJest.configs.recommended.rules,
174-
...eslintPluginJest.configs.style.rules,
175-
176-
// Optional jest rules:
177-
'jest/consistent-test-it': 'error',
178-
'jest/no-duplicate-hooks': 'error',
179-
'jest/no-hooks': 'error',
180-
'jest/no-if': 'error',
181-
'jest/no-large-snapshots': 'error',
182-
'jest/no-restricted-matchers': 'error',
183-
'jest/no-test-return-statement': 'error',
184-
'jest/prefer-called-with': 'error',
185-
'jest/prefer-hooks-on-top': 'error',
186-
'jest/prefer-lowercase-title': 'error',
187-
'jest/prefer-spy-on': 'error',
188-
'jest/prefer-strict-equal': 'error',
189-
'jest/prefer-todo': 'error',
190-
'jest/require-to-throw-message': 'error',
191-
'jest/require-top-level-describe': 'error',
192-
'jest/valid-title': 'error',
193-
},
170+
plugins: {},
194171
languageOptions: {
195172
globals: {
196173
...globals.jest,
@@ -216,10 +193,6 @@ module.exports = [
216193
'filenames/match-regex': 'off',
217194
'import/no-unresolved': 'off',
218195
'import/unambiguous': 'off',
219-
'jest/expect-expect': 'off',
220-
'jest/no-done-callback': 'off',
221-
'jest/no-test-callback': 'off',
222-
'jest/require-top-level-describe': 'off',
223196
'n/no-extraneous-import': 'off',
224197
'n/no-missing-import': 'off',
225198
'n/no-missing-require': 'off',

package.json

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,12 @@
5252
"lint:remote": "eslint-remote-tester",
5353
"release": "release-it",
5454
"start": "pnpm test:watch",
55-
"test": "jest",
56-
"test:coverage": "jest --coverage",
57-
"test:watch": "jest --watchAll",
55+
"test": "vitest run",
56+
"test:coverage": "vitest --coverage",
57+
"test:watch": "vitest",
5858
"update": "node ./scripts/update-rules.js && node ./scripts/list-jquery-methods.js && npm-run-all update:eslint-docs",
5959
"update:eslint-docs": "eslint-doc-generator"
6060
},
61-
"jest": {
62-
"coverageThreshold": {
63-
"global": {
64-
"branches": 95,
65-
"functions": 98.95,
66-
"lines": 98,
67-
"statements": 98
68-
}
69-
},
70-
"testMatch": [
71-
"**/tests/**/*.js"
72-
],
73-
"testPathIgnorePatterns": [
74-
"<rootDir>/tests/helpers/"
75-
]
76-
},
7761
"dependencies": {
7862
"@ember-data/rfc395-data": "^0.0.4",
7963
"css-tree": "^2.3.1",
@@ -87,6 +71,7 @@
8771
"snake-case": "^3.0.3"
8872
},
8973
"devDependencies": {
74+
"@babel/core": "^7.25.9",
9075
"@babel/eslint-parser": "^7.22.15",
9176
"@babel/plugin-proposal-class-properties": "^7.18.6",
9277
"@babel/plugin-proposal-decorators": "^7.23.2",
@@ -95,21 +80,20 @@
9580
"@release-it-plugins/lerna-changelog": "^6.0.0",
9681
"@types/eslint": "^8.44.6",
9782
"@typescript-eslint/parser": "^7.0.1",
83+
"@vitest/coverage-v8": "^2.1.3",
9884
"eslint": "^8.55.0",
9985
"eslint-config-prettier": "^9.0.0",
10086
"eslint-doc-generator": "^1.5.3",
10187
"eslint-plugin-eslint-comments": "^3.2.0",
10288
"eslint-plugin-eslint-plugin": "^5.1.1",
10389
"eslint-plugin-filenames": "^1.3.2",
10490
"eslint-plugin-import": "^2.29.0",
105-
"eslint-plugin-jest": "^27.8.0",
10691
"eslint-plugin-markdown": "^3.0.1",
10792
"eslint-plugin-n": "^16.2.0",
10893
"eslint-plugin-prettier": "^5.0.1",
10994
"eslint-plugin-unicorn": "^51.0.0",
11095
"eslint-remote-tester": "^3.0.1",
11196
"globals": "^14.0.0",
112-
"jest": "^29.7.0",
11397
"jquery": "^3.7.1",
11498
"jsdom": "^24.0.0",
11599
"markdownlint-cli": "^0.39.0",
@@ -119,7 +103,9 @@
119103
"release-it": "^17.0.0",
120104
"sort-package-json": "^2.6.0",
121105
"typescript": "^5.2.2",
122-
"typescript-eslint": "^8.7.0"
106+
"typescript-eslint": "^8.7.0",
107+
"vite": "^5.4.9",
108+
"vitest": "^2.1.3"
123109
},
124110
"peerDependencies": {
125111
"@typescript-eslint/parser": "*",

0 commit comments

Comments
 (0)