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 @@ -60,10 +60,22 @@ function validateReadFileAbortLogicDuring() {
60
60
} ) ;
61
61
}
62
62
63
+ async function validateWrongSignalParam ( ) {
64
+ // Verify that if something different than Abortcontroller.signal
65
+ // is passed, ERR_INVALID_ARG_TYPE is thrown
66
+
67
+ await assert . rejects ( async ( ) => {
68
+ const callback = common . mustNotCall ( ( ) => { } ) ;
69
+ await readFile ( fn , { signal : 'hello' } , callback ) ;
70
+ } , { code : 'ERR_INVALID_ARG_TYPE' , name : 'TypeError' } ) ;
71
+
72
+ }
73
+
63
74
( async ( ) => {
64
75
await createLargeFile ( ) ;
65
76
await validateReadFile ( ) ;
66
77
await validateReadFileProc ( ) ;
67
78
await validateReadFileAbortLogicBefore ( ) ;
68
79
await validateReadFileAbortLogicDuring ( ) ;
80
+ await validateWrongSignalParam ( ) ;
69
81
} ) ( ) . then ( common . mustCall ( ) ) ;
You can’t perform that action at this time.
0 commit comments