Skip to content

Commit ad37d5b

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 23d3d3e commit ad37d5b

File tree

3 files changed

+763
-2099
lines changed

3 files changed

+763
-2099
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"@vue/compat": "^3.1.5",
2727
"@vue/compiler-dom": "^3.1.4",
2828
"@vue/compiler-sfc": "3.1.5",
29-
"babel-jest": "^26.6.3",
30-
"babel-preset-jest": "^27.0.6",
29+
"babel-jest": "27.0.6",
30+
"babel-preset-jest": "27.0.6",
3131
"husky": "^7.0.1",
32-
"jest": "25.5.4",
32+
"jest": "27.0.6",
3333
"jsdom": "^16.6.0",
3434
"jsdom-global": "^3.0.2",
3535
"lint-staged": "^11.1.1",
@@ -38,12 +38,12 @@
3838
"reflect-metadata": "^0.1.13",
3939
"rollup": "^2.55.1",
4040
"rollup-plugin-typescript2": "^0.30.0",
41-
"ts-jest": "25.3.1",
41+
"ts-jest": "27.0.3",
4242
"typescript": "^4.3.5",
4343
"vitepress": "^0.15.6",
4444
"vue": "3.1.5",
4545
"vue-class-component": "^8.0.0-rc.1",
46-
"vue-jest": "^5.0.0-alpha.10",
46+
"vue3-jest": "27.0.0-alpha.2",
4747
"vue-router": "^4.0.10",
4848
"vue-tsc": "0.2.2",
4949
"vuex": "^4.0.2"

0 commit comments

Comments
 (0)