Skip to content

Commit 4f095f0

Browse files
committed
workflow: fix test script args
1 parent 29557a7 commit 4f095f0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

scripts/test.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
const execa = require('execa')
22
const minimist = require('minimist')
33

4-
const args = minimist(process.argv.slice(2))
4+
const rawArgs = process.argv.slice(2)
5+
const args = minimist(rawArgs)
56

6-
let regex = args._[0]
7-
if (args.p || args.package) {
7+
let regex
8+
if (args.p) {
89
const packages = (args.p || args.package).split(',').join('|')
910
regex = `.*@vue/(${packages}|cli-plugin-(${packages}))/.*\\.spec\\.js$`
11+
const i = rawArgs.findIndex('-p')
12+
rawArgs.splice(i, 2)
1013
}
1114

1215
;(async () => {
13-
await execa('jest', [
16+
const jestArgs = [
1417
'--env', 'node',
1518
'--runInBand',
19+
...rawArgs,
1620
...(regex ? [regex] : [])
17-
], {
21+
]
22+
console.log(`running jest with args: ${jestArgs.join(' ')}`)
23+
await execa('jest', jestArgs, {
1824
stdio: 'inherit'
1925
})
2026
})().catch(err => {

0 commit comments

Comments
 (0)