fix: revert accidentally committed jest related changes

This commit is contained in:
Haoqun Jiang
2019-04-30 19:50:49 +08:00
parent 911fddb26a
commit f395697197
4 changed files with 17 additions and 8 deletions

View File

@@ -25,6 +25,8 @@ test('base', async () => {
// should inject babel-jest
expect(pkg.devDependencies).toHaveProperty('babel-jest')
// babel-core 6 -> 7 shim
expect(pkg.devDependencies).toHaveProperty('babel-core')
// eslint
expect(files['tests/unit/.eslintrc.js']).toMatch('jest: true')

View File

@@ -54,14 +54,22 @@ module.exports = (api, _, __, invoking) => {
if (api.hasPlugin('babel')) {
api.extendPackage({
devDependencies: {
'babel-jest': '^24.7.1'
'babel-jest': '^23.6.0',
// this is for now necessary to force babel-jest and vue-jest to use babel 7
'babel-core': '7.0.0-bridge.0'
}
})
} else {
api.extendPackage({
babel: {
plugins: ['transform-es2015-modules-commonjs']
}
// Jest's shipped babel-jest still uses babel 6,
// so we cannot use extendPackage which renders babel.config.js.
api.render(files => {
files['.babelrc'] = JSON.stringify(
{
plugins: ['transform-es2015-modules-commonjs']
},
null,
2
)
})
}
} else {

View File

@@ -23,10 +23,9 @@
"access": "public"
},
"dependencies": {
"@babel/core": "^7.4.4",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@vue/cli-shared-utils": "^3.6.0",
"babel-jest": "^24.7.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"jest": "^24.7.1",
"jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^2.0.0",

View File

@@ -3507,7 +3507,7 @@ babel-plugin-syntax-object-rest-spread@^6.8.0:
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=
babel-plugin-transform-es2015-modules-commonjs@^6.26.0:
babel-plugin-transform-es2015-modules-commonjs@^6.26.0, babel-plugin-transform-es2015-modules-commonjs@^6.26.2:
version "6.26.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3"
integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==