Skip to content

Commit cf8d025

Browse files
shootermvtargos
authored andcommitted
test: increase abort logic coverage
PR-URL: #36586 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent c308b06 commit cf8d025

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎test/parallel/test-fs-promises-readfile.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,22 @@ function validateReadFileAbortLogicDuring(){
6161
});
6262
}
6363

64+
asyncfunctionvalidateWrongSignalParam(){
65+
// Verify that if something different than Abortcontroller.signal
66+
// is passed, ERR_INVALID_ARG_TYPE is thrown
67+
68+
awaitassert.rejects(async()=>{
69+
constcallback=common.mustNotCall(()=>{});
70+
awaitreadFile(fn,{signal: 'hello'},callback);
71+
},{code: 'ERR_INVALID_ARG_TYPE',name: 'TypeError'});
72+
73+
}
74+
6475
(async()=>{
6576
awaitcreateLargeFile();
6677
awaitvalidateReadFile();
6778
awaitvalidateReadFileProc();
6879
awaitvalidateReadFileAbortLogicBefore();
6980
awaitvalidateReadFileAbortLogicDuring();
81+
awaitvalidateWrongSignalParam();
7082
})().then(common.mustCall());

0 commit comments

Comments
(0)