diff options
Diffstat (limited to 'test/parallel/test-fs-promises-watch.js')
-rw-r--r-- | test/parallel/test-fs-promises-watch.js | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/test/parallel/test-fs-promises-watch.js b/test/parallel/test-fs-promises-watch.js index 31ab1aafd43..055e798d0e4 100644 --- a/test/parallel/test-fs-promises-watch.js +++ b/test/parallel/test-fs-promises-watch.js @@ -75,33 +75,45 @@ for (const testCase of kCases) { } assert.rejects( - // eslint-disable-next-line no-unused-vars - async () => { for await (const _ of watch(1)) {} }, + async () => { + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch(1)) { } + }, { code: 'ERR_INVALID_ARG_TYPE' }); assert.rejects( - // eslint-disable-next-line no-unused-vars - async () => { for await (const _ of watch(__filename, 1)) {} }, + async () => { + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch(__filename, 1)) { } + }, { code: 'ERR_INVALID_ARG_TYPE' }); assert.rejects( - // eslint-disable-next-line no-unused-vars - async () => { for await (const _ of watch('', { persistent: 1 })) {} }, + async () => { + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch('', { persistent: 1 })) { } + }, { code: 'ERR_INVALID_ARG_TYPE' }); assert.rejects( - // eslint-disable-next-line no-unused-vars - async () => { for await (const _ of watch('', { recursive: 1 })) {} }, + async () => { + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch('', { recursive: 1 })) { } + }, { code: 'ERR_INVALID_ARG_TYPE' }); assert.rejects( - // eslint-disable-next-line no-unused-vars - async () => { for await (const _ of watch('', { encoding: 1 })) {} }, + async () => { + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch('', { encoding: 1 })) { } + }, { code: 'ERR_INVALID_ARG_VALUE' }); assert.rejects( - // eslint-disable-next-line no-unused-vars - async () => { for await (const _ of watch('', { signal: 1 })) {} }, + async () => { + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch('', { signal: 1 })) { } + }, { code: 'ERR_INVALID_ARG_TYPE' }); (async () => { @@ -109,8 +121,8 @@ assert.rejects( const { signal } = ac; setImmediate(() => ac.abort()); try { - // eslint-disable-next-line no-unused-vars - for await (const _ of watch(__filename, { signal })) {} + // eslint-disable-next-line no-unused-vars, no-empty + for await (const _ of watch(__filename, { signal })) { } } catch (err) { assert.strictEqual(err.name, 'AbortError'); } |