diff --git a/test/parallel/test-fs-readfile.js b/test/parallel/test-fs-readfile.js index 3e61a465b55b43..b7d798a5db8e9b 100644 --- a/test/parallel/test-fs-readfile.js +++ b/test/parallel/test-fs-readfile.js @@ -70,3 +70,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' }); +}