summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2018-09-12 20:47:56 -0700
committerRich Trott <rtrott@gmail.com>2018-09-15 04:07:36 -0700
commit16210cad093519b756f2ce8025b29eb9f8d2d046 (patch)
treeef5372546254131a6c131c3b18ed5a45b16bf1cb /test
parentde37ba34c5d6f3a2d18daf482f850be8fddb4621 (diff)
downloadandroid-node-v8-16210cad093519b756f2ce8025b29eb9f8d2d046.tar.gz
android-node-v8-16210cad093519b756f2ce8025b29eb9f8d2d046.tar.bz2
android-node-v8-16210cad093519b756f2ce8025b29eb9f8d2d046.zip
fs: fix promisified fs.readdir withFileTypes
PR-URL: https://github.com/nodejs/node/pull/22832 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-fs-readdir-types.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-fs-readdir-types.js b/test/parallel/test-fs-readdir-types.js
index 75452895cc..0faaeb00da 100644
--- a/test/parallel/test-fs-readdir-types.js
+++ b/test/parallel/test-fs-readdir-types.js
@@ -57,6 +57,14 @@ fs.readdir(readdirDir, {
assertDirents(dirents);
}));
+// Check the promisified version
+assert.doesNotReject(async () => {
+ const dirents = await fs.promises.readdir(readdirDir, {
+ withFileTypes: true
+ });
+ assertDirents(dirents);
+});
+
// Check for correct types when the binding returns unknowns
const UNKNOWN = constants.UV_DIRENT_UNKNOWN;
const oldReaddir = binding.readdir;