Skip to content

Commit 646be10

Browse files
committed
chore: migrate to vitest
1 parent 7993280 commit 646be10

23 files changed

+1113
-1664
lines changed

eslint.config.mjs

+5-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import globals from 'globals';
21
import babelParser from '@babel/eslint-parser';
32
import js from '@eslint/js';
43
import reactPlugin from 'eslint-plugin-react';
@@ -18,11 +17,6 @@ export default [
1817
},
1918
{
2019
languageOptions: {
21-
globals: {
22-
...globals.browser,
23-
...globals.node,
24-
},
25-
2620
parser: babelParser,
2721

2822
parserOptions: {
@@ -34,6 +28,11 @@ export default [
3428
react: {
3529
version: 'detect',
3630
},
31+
'import/resolver': {
32+
node: {
33+
extensions: ['.js', '.jsx'],
34+
},
35+
},
3736
},
3837

3938
rules: {
@@ -64,13 +63,4 @@ export default [
6463
'react/prop-types': 'off',
6564
},
6665
},
67-
{
68-
files: ['**/*-test.js'],
69-
70-
languageOptions: {
71-
globals: {
72-
...globals.jest,
73-
},
74-
},
75-
},
7666
];

package.json

+3-16
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"lint": "eslint src --report-unused-disable-directives",
1616
"prebump": "pnpm run --sequential '/lint|test/'",
1717
"prepublishOnly": "pnpm run build",
18-
"test": "cross-env BABEL_OUTPUT=commonjs jest",
18+
"test": "vitest run",
1919
"start": "webpack serve",
2020
"website:clean": "rm -rf examples/dist",
2121
"website:build": "cross-env BABEL_TARGET=examples NODE_ENV=production webpack",
@@ -58,7 +58,7 @@
5858
"@testing-library/jest-dom": "6.6.3",
5959
"@testing-library/react": "16.3.0",
6060
"@testing-library/user-event": "14.6.1",
61-
"babel-jest": "29.7.0",
61+
"@vitest/coverage-v8": "^3.1.1",
6262
"babel-loader": "10.0.0",
6363
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
6464
"cross-env": "7.0.3",
@@ -70,12 +70,9 @@
7070
"eslint-plugin-jsx-a11y": "6.10.2",
7171
"eslint-plugin-prettier": "5.2.6",
7272
"eslint-plugin-react": "7.37.5",
73-
"globals": "16.0.0",
7473
"hoist-non-react-statics": "3.3.2",
7574
"html-loader": "5.1.0",
7675
"html-webpack-plugin": "5.6.3",
77-
"jest": "29.7.0",
78-
"jest-environment-jsdom": "29.7.0",
7976
"less": "4.3.0",
8077
"less-loader": "12.2.0",
8178
"mini-css-extract-plugin": "2.9.2",
@@ -85,23 +82,13 @@
8582
"react-dom": "19.1.0",
8683
"react-live": "4.1.8",
8784
"react-modal": "3.16.3",
85+
"vitest": "^3.1.1",
8886
"webpack": "5.99.6",
8987
"webpack-cli": "6.0.1",
9088
"webpack-dev-server": "5.2.1"
9189
},
9290
"dependencies": {
9391
"clsx": "^2.0.0",
9492
"prop-types": "^15.5.0"
95-
},
96-
"jest": {
97-
"roots": [
98-
"src"
99-
],
100-
"testRegex": "/__tests__/.+-test\\.js$",
101-
"testEnvironment": "jsdom",
102-
"coveragePathIgnorePatterns": [
103-
"/node_module/",
104-
"/__tests__/"
105-
]
10693
}
10794
}

0 commit comments

Comments
 (0)