@@ -5,7 +5,6 @@ const { execSync, spawn } = require("child_process");
5
5
6
6
const ROOT = resolve ( join ( __dirname , ".." , ".." ) ) ;
7
7
const FEATURES_FOLDER = join ( ROOT , "features" ) ;
8
- const ROOT_BIN = join ( ROOT , "node_modules" , ".bin" ) ;
9
8
10
9
const execOptions = {
11
10
...process ,
@@ -19,7 +18,7 @@ console.info(`Looking for changed clients that has the legacy integration test t
19
18
20
19
let changedPackages = [ ] ;
21
20
try {
22
- changedPackages = execSync ( ` ${ join ( ROOT_BIN , " lerna" ) } changed` , execOptions ) . split ( "\n" ) ;
21
+ changedPackages = execSync ( "yarn exec lerna changed" , execOptions ) . split ( "\n" ) ;
23
22
} catch ( e ) {
24
23
// Swallow error because Lerna throws if no package changes.
25
24
}
@@ -36,11 +35,10 @@ if (tagsToTest.length === 0) {
36
35
}
37
36
38
37
// Cucumber requires cwd to contain the test cases.
39
- const command = `${ join ( "node_modules" , ".bin" , "cucumber-js" ) } ` ;
40
- const args = [ "--fail-fast" , "-t" , `"${ tagsToTest . join ( " or " ) } "` ] ;
41
- console . info ( `Running cucumber test: \n${ command } ${ args . join ( " " ) } ` ) ;
38
+ const args = [ "exec" , "cucumber-js" , "--fail-fast" , "-t" , `"${ tagsToTest . join ( " or " ) } "` ] ;
39
+ console . info ( `Running cucumber test: \nyarn ${ args . join ( " " ) } ` ) ;
42
40
43
- const cucumber = spawn ( command , args , { ...execOptions , cwd : ROOT , shell : true } ) ;
41
+ const cucumber = spawn ( "yarn" , args , { ...execOptions , cwd : ROOT , shell : true } ) ;
44
42
cucumber . stdout . pipe ( process . stdout ) ;
45
43
cucumber . stderr . pipe ( process . stderr ) ;
46
44
cucumber . on ( "close" , ( code ) => {
0 commit comments