Skip to content

Commit

Permalink
test: add await for rejects
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
emilsivervik and aduh95 committed Jan 19, 2021
1 parent 95a48bc commit 622ed80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-fs-promises-file-handle-readFile.js
Expand Up @@ -56,7 +56,7 @@ async function doReadAndCancel() {
const controller = new AbortController();
const { signal } = controller;
controller.abort();
assert.rejects(readFile(fileHandle, { signal }), {
await assert.rejects(readFile(fileHandle, { signal }), {
name: 'AbortError'
});
}
Expand All @@ -70,7 +70,7 @@ async function doReadAndCancel() {
const controller = new AbortController();
const { signal } = controller;
tick(1, () => controller.abort());
assert.rejects(readFile(fileHandle, { signal }), {
await assert.rejects(readFile(fileHandle, { signal }), {
name: 'AbortError'
});
}
Expand All @@ -86,7 +86,7 @@ async function doReadAndCancel() {
const controller = new AbortController();
const { signal } = controller;
tick(2, () => controller.abort());
assert.rejects(fileHandle.readFile({ signal, encoding: 'utf8' }), {
await assert.rejects(fileHandle.readFile({ signal, encoding: 'utf8' }), {
name: 'AbortError'
});
}
Expand All @@ -102,7 +102,7 @@ async function doReadAndCancel() {

const fileHandle = await open(newFile, 'r');

assert.rejects(fileHandle.readFile(), {
await assert.rejects(fileHandle.readFile(), {
name: 'RangeError',
code: 'ERR_FS_FILE_TOO_LARGE'
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-promises-file-handle-writeFile.js
Expand Up @@ -34,7 +34,7 @@ async function doWriteAndCancel() {
const controller = new AbortController();
const { signal } = controller;
process.nextTick(() => controller.abort());
assert.rejects(writeFile(fileHandle, buffer, { signal }), {
await assert.rejects(writeFile(fileHandle, buffer, { signal }), {
name: 'AbortError'
});
}
Expand Down

0 comments on commit 622ed80

Please sign in to comment.