File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,12 +250,27 @@ async function checkExecution() {
250250 } ) ( ) ;
251251}
252252
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+
253267const finished = common . mustCall ( ) ;
254268
255269( async function main ( ) {
256270 await checkArgType ( ) ;
257271 await checkModuleState ( ) ;
258272 await checkLinking ( ) ;
259273 await checkExecution ( ) ;
274+ await checkInvalidOptionForEvaluate ( ) ;
260275 finished ( ) ;
261276} ) ( ) ;
You can’t perform that action at this time.
0 commit comments