Skip to content

Commit 2aee4a6

Browse files
committed
feat(vite): enable running jest tests with vite
1 parent f4ef74f commit 2aee4a6

File tree

3 files changed

+2046
-42
lines changed

3 files changed

+2046
-42
lines changed

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"clean": "rm -rf dist",
3232
"serve": "vite preview",
3333
"test": "run-s test:unit test:e2e",
34-
"test:unit": "vite test:unit",
34+
"test:unit": "jest",
3535
"test:e2e": "concurrently --n \"vite,cypress\" --p \"[{name}]\" -c \"green,yellow\" \"yarn dev\" \"npx cypress run --browser chrome\" -k",
3636
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
3737
"lint:ci": "eslint --no-fix --max-warnings 0",
@@ -56,9 +56,12 @@
5656
"@testing-library/jest-dom": "5.16.5",
5757
"@testing-library/vue": "6.6.1",
5858
"@types/jest": "24.9.1",
59+
"@types/node": "^18.16.1",
5960
"@typescript-eslint/eslint-plugin": "5.20.0",
6061
"@typescript-eslint/parser": "5.20.0",
6162
"@vitejs/plugin-vue": "^1.6.1",
63+
"@vue/cli-plugin-babel": "^5.0.8",
64+
"@vue/cli-plugin-unit-jest": "^5.0.8",
6265
"@vue/compiler-sfc": "3.2.47",
6366
"@vue/eslint-config-prettier": "6.0.0",
6467
"@vue/eslint-config-typescript": "10.0.0",

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"baseUrl": ".",
1414
"types": [
1515
"webpack-env",
16-
"jest"
16+
"jest",
17+
"node"
1718
],
1819
"paths": {
1920
"@/*": [

0 commit comments

Comments
 (0)