Skip to content

Commit

Permalink
fix(unit-mocha): fix test glob to avoid running e2e tests
Browse files Browse the repository at this point in the history
fix #790
  • Loading branch information
yyx990803 committed Feb 6, 2018
1 parent e597d12 commit 172e8eb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/@vue/cli-plugin-unit-mocha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down

0 comments on commit 172e8eb

Please sign in to comment.