From e08603bb1e8194de25a16124ee98bd041381d02b Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 30 Apr 2019 09:10:41 +0800 Subject: [PATCH] feat!: upgrade to mocha 6 and use mochapack instead of mocha-webpack (#3914) also update jsdom version --- packages/@vue/cli-plugin-unit-mocha/index.js | 8 ++++---- packages/@vue/cli-plugin-unit-mocha/package.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/@vue/cli-plugin-unit-mocha/index.js b/packages/@vue/cli-plugin-unit-mocha/index.js index 491f4a22f..962457359 100644 --- a/packages/@vue/cli-plugin-unit-mocha/index.js +++ b/packages/@vue/cli-plugin-unit-mocha/index.js @@ -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() } diff --git a/packages/@vue/cli-plugin-unit-mocha/package.json b/packages/@vue/cli-plugin-unit-mocha/package.json index e9505f641..a6b7cc9d3 100644 --- a/packages/@vue/cli-plugin-unit-mocha/package.json +++ b/packages/@vue/cli-plugin-unit-mocha/package.json @@ -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",