File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -141,12 +141,14 @@ function test(includeExampleData) {
141
141
const got = jsonToGo ( testCase . input , null , null , includeExampleData ) ;
142
142
if ( got . error ) {
143
143
console . assert ( ! got . error , `format('${ testCase . input } '): ${ got . error } ` ) ;
144
+ process . exitCode = 16
144
145
} else {
145
146
const exp = includeExampleData ? testCase . expectedWithExample : testCase . expected
146
- console . assert (
147
- got . go === exp ,
147
+ const success = got . go === exp
148
+ console . assert ( success ,
148
149
`format('${ testCase . input } '): \n\tgot: ${ quote ( got . go ) } \n\twant: ${ quote ( exp ) } `
149
150
) ;
151
+ if ( ! success ) process . exitCode = 17
150
152
}
151
153
}
152
154
console . log ( includeExampleData ? "done testing samples with data" : "done testing samples without data" )
@@ -169,14 +171,17 @@ function testFiles() {
169
171
const got = jsonToGo ( jsonData ) ;
170
172
if ( got . error ) {
171
173
console . assert ( ! got . error , `format('${ jsonData } '): ${ got . error } ` ) ;
174
+ process . exitCode = 18
172
175
} else {
173
- console . assert (
174
- got . go === expectedGoData ,
176
+ const success = got . go === expectedGoData
177
+ console . assert ( success ,
175
178
`format('${ jsonData } '): \n\tgot: ${ quote ( got . go ) } \n\twant: ${ quote ( expectedGoData ) } `
176
179
) ;
180
+ if ( ! success ) process . exitCode = 19
177
181
}
178
182
} catch ( err ) {
179
183
console . error ( err ) ;
184
+ process . exitCode = 20
180
185
}
181
186
}
182
187
console . log ( "done testing files" )
You can’t perform that action at this time.
0 commit comments