@@ -3,15 +3,14 @@ import promiseSpawn from "@npmcli/promise-spawn";
33import { dirname , join , relative } from "path" ;
44import { fileURLToPath } from "url" ;
55import { parse as parseYaml } from "yaml" ;
6- import { spawn } from "child_process" ;
76import fsExtra from "fs-extra" ;
87import { scenarios } from "./scenarios.ts" ;
98
109const { readFileSync, mkdirp, rmdir } = fsExtra ;
1110
1211const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
1312
14- const errors : any [ ] = [ ] ;
13+ const errors : Error [ ] = [ ] ;
1514
1615await rmdir ( join ( __dirname , "runs" ) , { recursive : true } ) . catch ( ( ) => undefined ) ;
1716
@@ -58,7 +57,7 @@ for (const [scenarioName, scenario] of scenarios) {
5857 ) . version ;
5958
6059 try {
61- await promiseSpawn ( "node" , [ buildScript , ...scenario . inputs ] , {
60+ const result = await promiseSpawn ( "node" , [ buildScript , ...scenario . inputs ] , {
6261 cwd,
6362 stdioString : true ,
6463 stdio : "pipe" ,
@@ -67,10 +66,9 @@ for (const [scenarioName, scenario] of scenarios) {
6766 ...process . env ,
6867 FRAMEWORK_VERSION : frameworkVersion ,
6968 } ,
70- } ) . then ( ( result ) => {
71- // Write stdout and stderr to the log file
72- fsExtra . writeFileSync ( buildLogPath , result . stdout + result . stderr ) ;
7369 } ) ;
70+ // Write stdout and stderr to the log file
71+ fsExtra . writeFileSync ( buildLogPath , result . stdout + result . stderr ) ;
7472
7573 try {
7674 // Determine which test files to run
@@ -96,9 +94,8 @@ for (const [scenarioName, scenario] of scenarios) {
9694 console . error ( `Error in scenario ${ scenarioName } :` , e ) ;
9795 errors . push ( e ) ;
9896 }
99-
100- if ( errors . length ) {
101- console . error ( errors ) ;
102- process . exit ( 1 ) ;
103- }
97+ }
98+ if ( errors . length ) {
99+ console . error ( errors ) ;
100+ process . exit ( 1 ) ;
104101}
0 commit comments