From 172e8ebaa089a3845ff9440725dd51d036de1b20 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 6 Feb 2018 10:39:41 -0500 Subject: [PATCH] fix(unit-mocha): fix test glob to avoid running e2e tests fix #790 --- packages/@vue/cli-plugin-unit-mocha/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/@vue/cli-plugin-unit-mocha/index.js b/packages/@vue/cli-plugin-unit-mocha/index.js index 6914bed77b..87f12d016a 100644 --- a/packages/@vue/cli-plugin-unit-mocha/index.js +++ b/packages/@vue/cli-plugin-unit-mocha/index.js @@ -32,13 +32,18 @@ module.exports = api => { // start runner const execa = require('execa') const bin = require.resolve('mocha-webpack/bin/mocha-webpack') - const argv = rawArgv.concat([ + const hasInlineFilesGlob = args._ && args._.length + const argv = [ '--recursive', '--require', require.resolve('./setup.js'), '--webpack-config', - require.resolve('@vue/cli-service/webpack.config.js') - ]) + require.resolve('@vue/cli-service/webpack.config.js'), + ...rawArgv, + ...(hasInlineFilesGlob ? [] : [`test/unit/**/*.js`]) + ] + + console.log(argv) return new Promise((resolve, reject) => { const child = execa(bin, argv, { stdio: 'inherit' })