File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ function runTests() {
118118 encoding : "utf8" ,
119119 } ) ;
120120 var files = fs . readdirSync ( buildTestDir ) ;
121- var failed = [ ] ;
122121 files . forEach ( function ( file ) {
123122 var testDir = path . join ( buildTestDir , file ) ;
124123 if ( file === "node_modules" || ! fs . lstatSync ( testDir ) . isDirectory ( ) ) {
@@ -129,20 +128,22 @@ function runTests() {
129128 } else {
130129 console . log ( `testing ${ file } ` ) ;
131130 // note existsSync test already ensure that it is a directory
132- try {
133- cp . exec ( `node input.js` , { cwd : testDir , encoding : "utf8" } ) ;
134- console . log ( "✅ success in " , file ) ;
135- } catch ( e ) {
136- failed . push ( file ) ;
137- console . log ( "❌ error" , e ) ;
138- }
131+ cp . exec (
132+ `node input.js` ,
133+ { cwd : testDir , encoding : "utf8" } ,
134+ function ( error , stdout , stderr ) {
135+ console . log ( stdout ) ;
136+
137+ if ( error !== null ) {
138+ console . log ( stderr ) ;
139+ throw new Error ( `❌ error in ${ file } : \n${ error } ` ) ;
140+ } else {
141+ console . log ( "✅ success in " , file ) ;
142+ }
143+ }
144+ ) ;
139145 }
140146 } ) ;
141- if ( failed . length > 0 ) {
142- console . log ( "" ) ;
143- console . log ( "❌ Build tests failed" , failed ) ;
144- throw new Error ( ) ;
145- }
146147 }
147148}
148149
You can’t perform that action at this time.
0 commit comments