feat!: upgrade to mocha 6 and use mochapack instead of mocha-webpack (#3914)

also update jsdom version
This commit is contained in:
Haoqun Jiang
2019-04-30 09:10:41 +08:00
parent 2ec3fca99a
commit e08603bb1e
2 changed files with 8 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ module.exports = api => {
})
api.registerCommand('test:unit', {
description: 'run unit tests with mocha-webpack',
description: 'run unit tests with mochapack',
usage: 'vue-cli-service test:unit [options] [...files]',
options: {
'--watch, -w': 'run in watch mode',
@@ -34,7 +34,7 @@ module.exports = api => {
details: (
`The above list only includes the most commonly used options.\n` +
`For a full list of available options, see\n` +
`http://zinserjan.github.io/mocha-webpack/docs/installation/cli-usage.html`
`https://sysgears.github.io/mochapack/docs/installation/cli-usage.html`
)
}, (args, rawArgv) => {
const inspectPos = rawArgv.indexOf('--inspect-brk')
@@ -46,7 +46,7 @@ module.exports = api => {
process.env.VUE_CLI_BABEL_TARGET_NODE = true
// start runner
const { execa } = require('@vue/cli-shared-utils')
const bin = require.resolve('mocha-webpack/bin/mocha-webpack')
const bin = require.resolve('mochapack/bin/mochapack')
const hasInlineFilesGlob = args._ && args._.length
const argv = [
...nodeArgs,
@@ -69,7 +69,7 @@ module.exports = api => {
child.on('error', reject)
child.on('exit', code => {
if (code !== 0) {
reject(`mocha-webpack exited with code ${code}.`)
reject(`mochapack exited with code ${code}.`)
} else {
resolve()
}

View File

@@ -22,11 +22,11 @@
},
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
"dependencies": {
"@vue/cli-shared-utils": "^3.7.0",
"jsdom": "^13.2.0",
"@vue/cli-shared-utils": "^3.6.0",
"jsdom": "^15.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^5.2.0",
"mocha-webpack": "^2.0.0-beta.0"
"mocha": "^6.1.4",
"mochapack": "^1.1.1"
},
"devDependencies": {
"@vue/test-utils": "1.0.0-beta.29",