Files
vue-cli/scripts/test.js
Haoqun Jiang e41ef41540 chore!: drop webpack-4 support in v5 (#6598)
1. I don't think I'll ever have the capacity to keep maintaining this
compat plugin. It's better to drop it now than later.
2. The plugin is needed at the time of alpha.0 because many ecosystem
plugins does not support webpack 5. But now I don't think it will be a
major hurdle.
3. The implementation was too hacky.
2021-07-30 14:03:54 +08:00

35 lines
791 B
JavaScript

const minimist = require('minimist')
const rawArgs = process.argv.slice(2)
const args = minimist(rawArgs)
let regex
if (args.p) {
const packages = (args.p || args.package).split(',').join('|')
regex = `.*@vue/(${packages}|cli-plugin-(${packages}))/.*\\.spec\\.js$`
const i = rawArgs.indexOf('-p')
rawArgs.splice(i, 2)
}
const e2ePathPattern = 'Migrator|Vue3|mochaPlugin|MochaPlugin'
if (args['e2e-only']) {
regex = e2ePathPattern
const i = rawArgs.indexOf('--e2e-only')
rawArgs.splice(i, 2)
}
const jestArgs = [
'--env', 'node',
'--runInBand',
...rawArgs,
...(regex ? [regex] : [])
]
if (!args['e2e-only']) {
jestArgs.push('--testPathIgnorePatterns', e2ePathPattern)
}
console.log(`running jest with args: ${jestArgs.join(' ')}`)
require('jest').run(jestArgs)