diff --git a/test/parallel/test-fs-readfile.js b/test/parallel/test-fs-readfile.js index 751043886f0d96..8273b864907c9f 100644 --- a/test/parallel/test-fs-readfile.js +++ b/test/parallel/test-fs-readfile.js @@ -75,3 +75,11 @@ for (const e of fileInfo) { })); process.nextTick(() => controller.abort()); } +{ + // Verify that if something different than Abortcontroller.signal + // is passed, ERR_INVALID_ARG_TYPE is thrown + assert.throws(() => { + const callback = common.mustNotCall(() => {}); + fs.readFile(fileInfo[0].name, { signal: 'hello' }, callback); + }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' }); +}