File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ function runTests() {
118
118
encoding : "utf8" ,
119
119
} ) ;
120
120
var files = fs . readdirSync ( buildTestDir ) ;
121
- var failed = [ ] ;
122
121
files . forEach ( function ( file ) {
123
122
var testDir = path . join ( buildTestDir , file ) ;
124
123
if ( file === "node_modules" || ! fs . lstatSync ( testDir ) . isDirectory ( ) ) {
@@ -129,20 +128,22 @@ function runTests() {
129
128
} else {
130
129
console . log ( `testing ${ file } ` ) ;
131
130
// 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
+ ) ;
139
145
}
140
146
} ) ;
141
- if ( failed . length > 0 ) {
142
- console . log ( "" ) ;
143
- console . log ( "❌ Build tests failed" , failed ) ;
144
- throw new Error ( ) ;
145
- }
146
147
}
147
148
}
148
149
You can’t perform that action at this time.
0 commit comments