File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,22 @@ function validateReadFileAbortLogicDuring() {
6161 } ) ;
6262}
6363
64+ async function validateWrongSignalParam ( ) {
65+ // Verify that if something different than Abortcontroller.signal
66+ // is passed, ERR_INVALID_ARG_TYPE is thrown
67+
68+ await assert . rejects ( async ( ) => {
69+ const callback = common . mustNotCall ( ( ) => { } ) ;
70+ await readFile ( fn , { signal : 'hello' } , callback ) ;
71+ } , { code : 'ERR_INVALID_ARG_TYPE' , name : 'TypeError' } ) ;
72+
73+ }
74+
6475( async ( ) => {
6576 await createLargeFile ( ) ;
6677 await validateReadFile ( ) ;
6778 await validateReadFileProc ( ) ;
6879 await validateReadFileAbortLogicBefore ( ) ;
6980 await validateReadFileAbortLogicDuring ( ) ;
81+ await validateWrongSignalParam ( ) ;
7082} ) ( ) . then ( common . mustCall ( ) ) ;
You can’t perform that action at this time.
0 commit comments