@@ -3,7 +3,7 @@ const { readFileSync } = require("fs");
33const path = require ( "path" ) ;
44const fs = require ( "fs" ) ;
55
6- function testFn ( ) {
6+ function testFn ( outArgv ) {
77// search for dev-server port
88// start in current folder
99// traversing upwards in case of mono repo tests and dev-server running in root folder of repository
@@ -48,15 +48,15 @@ function testFn() {
4848
4949// add single spec parameter if passed
5050 let spec = "" ;
51- if ( process . argv . length === 3 ) {
52- const specFile = process . argv [ 2 ] ;
51+ if ( outArgv . length === 3 ) {
52+ const specFile = outArgv [ 2 ] ;
5353 spec = `--spec ${ specFile } ` ;
5454 }
5555
5656// more parameters - pass them to wdio
5757 let restParams = "" ;
58- if ( process . argv . length > 3 ) {
59- restParams = process . argv . slice ( 2 ) . join ( " " ) ;
58+ if ( outArgv . length > 3 ) {
59+ restParams = outArgv . slice ( 2 ) . join ( " " ) ;
6060 }
6161
6262 let wdioConfig = "" ;
@@ -67,7 +67,7 @@ function testFn() {
6767 }
6868
6969// run wdio with calculated parameters
70- const cmd = `yarn cross-env WDIO_LOG_LEVEL=error wdio ${ wdioConfig } ${ spec } ${ baseUrl } ${ restParams } ` ;
70+ const cmd = `npx cross-env WDIO_LOG_LEVEL=error wdio ${ wdioConfig } ${ spec } ${ baseUrl } ${ restParams } ` ;
7171 console . log ( `executing: ${ cmd } ` ) ;
7272 child_process . execSync ( cmd , { stdio : 'inherit' } ) ;
7373}
0 commit comments