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 11const execa = require ( 'execa' )
22const 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 => {
You can’t perform that action at this time.
0 commit comments