Skip to content

Commit 226d3f1

Browse files
committed
chore: update to jest 27
Updates jest, ts-jest and babel-jest to v27. vue-jest v5 does not support jest v27, so a new vue3-jest package has been introduced (see vuejs/vue-jest#343), with a version number aligned on the jest version (as ts-jest and babel-jest do). This commits replaces vue-jest by vue3-jest, and updates the jest config to use this new trasnformer. This will be the default Vue CLI setup in the future.
1 parent 437aac9 commit 226d3f1

File tree

3 files changed

+1290
-3003
lines changed

3 files changed

+1290
-3003
lines changed

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
},
1313
testEnvironment: 'jsdom',
1414
transform: {
15-
'^.+\\.vue$': 'vue-jest',
15+
'^.+\\.vue$': 'vue3-jest',
1616
'^.+\\js$': 'babel-jest'
1717
},
1818
moduleFileExtensions: ['vue', 'js', 'json', 'jsx', 'ts', 'tsx', 'node'],

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"@vue/compat": "3.2.4",
2727
"@vue/compiler-dom": "3.2.6",
2828
"@vue/compiler-sfc": "3.2.6",
29-
"babel-jest": "^26.6.3",
30-
"babel-preset-jest": "^27.0.6",
29+
"babel-jest": "27.1.0",
30+
"babel-preset-jest": "27.0.6",
3131
"husky": "^7.0.1",
32-
"jest": "25.5.4",
32+
"jest": "27.1.0",
3333
"jsdom": "^17.0.0",
3434
"jsdom-global": "^3.0.2",
3535
"lint-staged": "^11.1.2",
@@ -38,13 +38,13 @@
3838
"reflect-metadata": "^0.1.13",
3939
"rollup": "^2.56.3",
4040
"rollup-plugin-typescript2": "^0.30.0",
41-
"ts-jest": "25.3.1",
41+
"ts-jest": "27.0.5",
4242
"tslib": "^2.3.1",
4343
"typescript": "^4.3.5",
4444
"vitepress": "^0.16.1",
4545
"vue": "3.2.6",
4646
"vue-class-component": "^8.0.0-rc.1",
47-
"vue-jest": "^5.0.0-alpha.10",
47+
"vue3-jest": "27.0.0-alpha.2",
4848
"vue-router": "^4.0.11",
4949
"vue-tsc": "0.3.0",
5050
"vuex": "^4.0.2"

0 commit comments

Comments
 (0)