Skip to content

Commit e08603b

Browse files
committed
feat!: upgrade to mocha 6 and use mochapack instead of mocha-webpack (#3914)
also update jsdom version
1 parent 2ec3fca commit e08603b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/@vue/cli-plugin-unit-mocha/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = api => {
1919
})
2020

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

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
},
2323
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
2424
"dependencies": {
25-
"@vue/cli-shared-utils": "^3.7.0",
26-
"jsdom": "^13.2.0",
25+
"@vue/cli-shared-utils": "^3.6.0",
26+
"jsdom": "^15.0.0",
2727
"jsdom-global": "^3.0.2",
28-
"mocha": "^5.2.0",
29-
"mocha-webpack": "^2.0.0-beta.0"
28+
"mocha": "^6.1.4",
29+
"mochapack": "^1.1.1"
3030
},
3131
"devDependencies": {
3232
"@vue/test-utils": "1.0.0-beta.29",

0 commit comments

Comments
 (0)