Skip to content

test: specify global object for globals #36498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/parallel/test-fs-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) => {
Expand Down