Skip to content

Commit 172e8eb

Browse files
committed
fix(unit-mocha): fix test glob to avoid running e2e tests
fix #790
1 parent e597d12 commit 172e8eb

File tree

1 file changed

+8
-3
lines changed
  • packages/@vue/cli-plugin-unit-mocha

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ module.exports = api => {
3232
// start runner
3333
const execa = require('execa')
3434
const bin = require.resolve('mocha-webpack/bin/mocha-webpack')
35-
const argv = rawArgv.concat([
35+
const hasInlineFilesGlob = args._ && args._.length
36+
const argv = [
3637
'--recursive',
3738
'--require',
3839
require.resolve('./setup.js'),
3940
'--webpack-config',
40-
require.resolve('@vue/cli-service/webpack.config.js')
41-
])
41+
require.resolve('@vue/cli-service/webpack.config.js'),
42+
...rawArgv,
43+
...(hasInlineFilesGlob ? [] : [`test/unit/**/*.js`])
44+
]
45+
46+
console.log(argv)
4247

4348
return new Promise((resolve, reject) => {
4449
const child = execa(bin, argv, { stdio: 'inherit' })

0 commit comments

Comments
 (0)