Skip to content

Commit 5d1da58

Browse files
committed
fix: fix peer dependencies for ts-jest & babel-jest
1 parent f395697 commit 5d1da58

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"devDependencies": {
4646
"@vuepress/plugin-pwa": "^1.0.0-alpha.47",
4747
"@vuepress/theme-vue": "1.0.0-alpha.44",
48-
"babel-core": "7.0.0-bridge.0",
4948
"babel-eslint": "^10.0.1",
5049
"debug": "^4.1.0",
5150
"eslint": "^5.16.0",
@@ -74,7 +73,6 @@
7473
"yorkie": "^2.0.0"
7574
},
7675
"resolutions": {
77-
"babel-core": "7.0.0-bridge.0",
7876
"puppeteer": "1.11.0",
7977
"vue": "^2.6.10",
8078
"vue-template-compiler": "^2.6.10",

packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ test('base', async () => {
2525

2626
// should inject babel-jest
2727
expect(pkg.devDependencies).toHaveProperty('babel-jest')
28-
// babel-core 6 -> 7 shim
29-
expect(pkg.devDependencies).toHaveProperty('babel-core')
28+
expect(pkg.devDependencies).toHaveProperty('@babel/core')
3029
// eslint
3130
expect(files['tests/unit/.eslintrc.js']).toMatch('jest: true')
3231

packages/@vue/cli-plugin-unit-jest/generator/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,17 @@ module.exports = (api, _, __, invoking) => {
5454
if (api.hasPlugin('babel')) {
5555
api.extendPackage({
5656
devDependencies: {
57-
'babel-jest': '^23.6.0',
58-
// this is for now necessary to force babel-jest and vue-jest to use babel 7
59-
'babel-core': '7.0.0-bridge.0'
57+
'babel-jest': '^24.7.1',
58+
'@babel/core': '^7.4.4'
6059
}
6160
})
6261
} else {
63-
// Jest's shipped babel-jest still uses babel 6,
64-
// so we cannot use extendPackage which renders babel.config.js.
62+
// ts-jest still does not support babel.config.js
63+
// https://github.com/kulshekhar/ts-jest/issues/933
6564
api.render(files => {
6665
files['.babelrc'] = JSON.stringify(
6766
{
68-
plugins: ['transform-es2015-modules-commonjs']
67+
plugins: ['@babel/plugin-transform-modules-commonjs']
6968
},
7069
null,
7170
2
@@ -106,6 +105,7 @@ const applyTS = (module.exports.applyTS = (api, invoking) => {
106105
},
107106
devDependencies: {
108107
// this is for now necessary to force ts-jest and vue-jest to use babel 7
108+
'@babel/core': '^7.4.4',
109109
'babel-core': '7.0.0-bridge.0'
110110
}
111111
})

packages/@vue/cli-plugin-unit-jest/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26+
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
2627
"@vue/cli-shared-utils": "^3.6.0",
28+
"babel-core": "7.0.0-bridge.0",
2729
"babel-jest": "^24.7.1",
28-
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
2930
"jest": "^24.7.1",
3031
"jest-serializer-vue": "^2.0.2",
3132
"jest-transform-stub": "^2.0.0",

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3507,7 +3507,7 @@ babel-plugin-syntax-object-rest-spread@^6.8.0:
35073507
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
35083508
integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=
35093509

3510-
babel-plugin-transform-es2015-modules-commonjs@^6.26.0, babel-plugin-transform-es2015-modules-commonjs@^6.26.2:
3510+
babel-plugin-transform-es2015-modules-commonjs@^6.26.0:
35113511
version "6.26.2"
35123512
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3"
35133513
integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==

0 commit comments

Comments
 (0)