File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -250,12 +250,27 @@ async function checkExecution() {
250
250
} ) ( ) ;
251
251
}
252
252
253
+ // Check for error thrown when breakOnSigint is not a boolean for evaluate()
254
+ async function checkInvalidOptionForEvaluate ( ) {
255
+ await assert . rejects ( async ( ) => {
256
+ const m = new SourceTextModule ( 'export const a = 1; export var b = 2' ) ;
257
+ await m . evaluate ( { breakOnSigint : 'a-string' } ) ;
258
+ } , {
259
+ name : 'TypeError' ,
260
+ message :
261
+ 'The "options.breakOnSigint" property must be of type boolean. ' +
262
+ 'Received type string' ,
263
+ code : 'ERR_INVALID_ARG_TYPE'
264
+ } ) ;
265
+ }
266
+
253
267
const finished = common . mustCall ( ) ;
254
268
255
269
( async function main ( ) {
256
270
await checkArgType ( ) ;
257
271
await checkModuleState ( ) ;
258
272
await checkLinking ( ) ;
259
273
await checkExecution ( ) ;
274
+ await checkInvalidOptionForEvaluate ( ) ;
260
275
finished ( ) ;
261
276
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments