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() {
61
61
} ) ;
62
62
}
63
63
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
+
64
75
( async ( ) => {
65
76
await createLargeFile ( ) ;
66
77
await validateReadFile ( ) ;
67
78
await validateReadFileProc ( ) ;
68
79
await validateReadFileAbortLogicBefore ( ) ;
69
80
await validateReadFileAbortLogicDuring ( ) ;
81
+ await validateWrongSignalParam ( ) ;
70
82
} ) ( ) . then ( common . mustCall ( ) ) ;
You can’t perform that action at this time.
0 commit comments