summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2020-12-13 05:16:23 -0800
committerMichaël Zasso <targos@protonmail.com>2020-12-21 18:24:26 +0100
commit81e603b7cfd249235b683b1829f7179fc7765993 (patch)
tree343ee1d10c02cffd8e27a84544dae9c6b471cdb1
parentc3ec90d23c92a953a78996d55c7cb6e637464c40 (diff)
downloadnode-new-81e603b7cfd249235b683b1829f7179fc7765993.tar.gz
test: specify global object for globals
Be explicit about using `global.externalizeString()` etc. in test-fs-write instead of disabling the `no-undef` ESLint rule. PR-URL: https://github.com/nodejs/node/pull/36498 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--test/parallel/test-fs-write.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js
index c52c958a1f..63f0245663 100644
--- a/test/parallel/test-fs-write.js
+++ b/test/parallel/test-fs-write.js
@@ -36,8 +36,10 @@ const fn4 = path.join(tmpdir.path, 'write4.txt');
const expected = 'ümlaut.';
const constants = fs.constants;
-/* eslint-disable no-undef */
-common.allowGlobals(externalizeString, isOneByteString, x);
+const { externalizeString, isOneByteString } = global;
+
+// Account for extra globals exposed by --expose_externalize_string.
+common.allowGlobals(externalizeString, isOneByteString, global.x);
{
const expected = 'ümlaut sechzig'; // Must be a unique string.
@@ -78,7 +80,6 @@ common.allowGlobals(externalizeString, isOneByteString, x);
fs.closeSync(fd);
assert.strictEqual(fs.readFileSync(fn, 'utf8'), expected);
}
-/* eslint-enable no-undef */
fs.open(fn, 'w', 0o644, common.mustSucceed((fd) => {
const done = common.mustSucceed((written) => {