mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-18 13:20:17 -06:00
feat!: upgrade to mocha 6 and use mochapack instead of mocha-webpack (#3914)
also update jsdom version
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user