mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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>
This commit is contained in:
1 parent
c32c109450
commit
5ef609af3e
1 file changed
+4
-3
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user