File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
const execa = require ( 'execa' )
2
2
const minimist = require ( 'minimist' )
3
3
4
- const args = minimist ( process . argv . slice ( 2 ) )
4
+ const rawArgs = process . argv . slice ( 2 )
5
+ const args = minimist ( rawArgs )
5
6
6
- let regex = args . _ [ 0 ]
7
- if ( args . p || args . package ) {
7
+ let regex
8
+ if ( args . p ) {
8
9
const packages = ( args . p || args . package ) . split ( ',' ) . join ( '|' )
9
10
regex = `.*@vue/(${ packages } |cli-plugin-(${ packages } ))/.*\\.spec\\.js$`
11
+ const i = rawArgs . findIndex ( '-p' )
12
+ rawArgs . splice ( i , 2 )
10
13
}
11
14
12
15
; ( async ( ) => {
13
- await execa ( 'jest' , [
16
+ const jestArgs = [
14
17
'--env' , 'node' ,
15
18
'--runInBand' ,
19
+ ...rawArgs ,
16
20
...( regex ? [ regex ] : [ ] )
17
- ] , {
21
+ ]
22
+ console . log ( `running jest with args: ${ jestArgs . join ( ' ' ) } ` )
23
+ await execa ( 'jest' , jestArgs , {
18
24
stdio : 'inherit'
19
25
} )
20
26
} ) ( ) . catch ( err => {
You can’t perform that action at this time.
0 commit comments