File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
packages/@vuepress/test-utils/lib Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
const execa = require ( 'execa' )
2
- const rawArgs = process . argv . slice ( 2 )
3
2
4
3
const usedPorts = [ ]
5
4
6
- module . exports = function createJestRunner ( jestArgs ) {
5
+ /**
6
+ * Run jest
7
+ *
8
+ * @param {array } jestArgs an array of Jest CLI options
9
+ * @param {array } rawArgs the processed process.argv - contains '--inspect-brk' for debug
10
+ */
11
+
12
+ module . exports = function createJestRunner ( jestArgs , rawArgs ) {
7
13
return async function ( ) {
8
14
const execArgv = getChildProcesExecArgv ( )
9
15
const args = [ ...execArgv , ...jestArgs ]
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const args = minimist(rawArgs)
8
8
let regex
9
9
if ( args . p ) {
10
10
const packages = ( args . p || args . package ) . split ( ',' ) . join ( '|' )
11
- regex = `.*@vuepress/(${ packages } |plugin-(${ packages } ))/.*\\.spec\\.js $`
11
+ regex = `.*@vuepress/(${ packages } |plugin-(${ packages } ))/.*\\.spec\\.(js|ts) $`
12
12
const i = rawArgs . indexOf ( '-p' )
13
13
rawArgs . splice ( i , 2 )
14
14
}
@@ -17,7 +17,7 @@ const jestRunner = createJestRunner([
17
17
'--config' , 'scripts/jest.config.js' ,
18
18
'--runInBand' ,
19
19
...( regex ? [ regex ] : [ ] )
20
- ] )
20
+ ] , rawArgs )
21
21
22
22
// ensure the basic temp files were generated
23
23
createApp ( {
You can’t perform that action at this time.
0 commit comments