diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2024-01-23 12:59:39 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 12:59:39 +0900 |
commit | 2af0c0a3c6ea017bef2481c1a1ce0806457d5427 (patch) | |
tree | ce75b5b9cc0d82d29526e4b47c1fd70bc94d27ae /cli/tests/unit_node/_fs/_fs_readFile_test.ts | |
parent | 7e4145df253e234c188be33ece2ae21753bc19af (diff) |
fix(ext/node): fix no arg call of fs.promises.readFile (#22030)
Diffstat (limited to 'cli/tests/unit_node/_fs/_fs_readFile_test.ts')
-rw-r--r-- | cli/tests/unit_node/_fs/_fs_readFile_test.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/tests/unit_node/_fs/_fs_readFile_test.ts b/cli/tests/unit_node/_fs/_fs_readFile_test.ts index 7d9e117ce..05cb90974 100644 --- a/cli/tests/unit_node/_fs/_fs_readFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readFile_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertCallbackErrorUncaught } from "../_test_utils.ts"; -import { readFile, readFileSync } from "node:fs"; +import { promises, readFile, readFileSync } from "node:fs"; import * as path from "../../../../test_util/std/path/mod.ts"; import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts"; @@ -116,3 +116,8 @@ Deno.test("[std/node/fs] readFile callback isn't called twice if error is thrown }, }); }); + +Deno.test("fs.promises.readFile with no arg call rejects with error correctly", async () => { + // @ts-ignore no arg call needs to be supported + await promises.readFile().catch((_e) => {}); +}); |