summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-05-09 12:36:59 -0400
committercjihrig <cjihrig@gmail.com>2018-05-11 22:18:01 -0400
commit20509ebee681233443ebc7dc1b58c2fab6d2b12f (patch)
tree90b5ba76a570072b6249567c100117f31702bfb2 /test
parent6fd8022641da3e58fa44f339457110b15813c9be (diff)
downloadandroid-node-v8-20509ebee681233443ebc7dc1b58c2fab6d2b12f.tar.gz
android-node-v8-20509ebee681233443ebc7dc1b58c2fab6d2b12f.tar.bz2
android-node-v8-20509ebee681233443ebc7dc1b58c2fab6d2b12f.zip
fs: make fs.promises non-enumerable
This prevents the experimental feature warning from being emitted in cases where fs.promises is not actually used. PR-URL: https://github.com/nodejs/node/pull/20632 Fixes: https://github.com/nodejs/node/issues/20504 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-fs-promises.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js
index 43b5da7004..8f1d646bb0 100644
--- a/test/parallel/test-fs-promises.js
+++ b/test/parallel/test-fs-promises.js
@@ -5,7 +5,8 @@ const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const path = require('path');
-const fsPromises = require('fs').promises;
+const fs = require('fs');
+const fsPromises = fs.promises;
const {
access,
chmod,
@@ -38,6 +39,10 @@ const tmpDir = tmpdir.path;
common.crashOnUnhandledRejection();
+// fs.promises should not be enumerable as long as it causes a warning to be
+// emitted.
+assert.strictEqual(Object.keys(fs).includes('promises'), false);
+
{
access(__filename, 'r')
.then(common.mustCall())