Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
squash: fix test in Workers
  • Loading branch information
LiviaMedeiros committed Apr 30, 2022
commit ac6e3f447ec93f9ef201390edb19787622e7b283
28 changes: 20 additions & 8 deletions test/parallel/test-icu-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,26 @@ if (isMockable) {

// Tests with process.env mutated inside
{
assert.strictEqual(
isSet(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toString()))),
true
);
assert.strictEqual(
isSet(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toLocaleString()))),
true
);
// process.env.TZ is not intercepted in Workers
if (common.isMainThread) {
assert.strictEqual(
isSet(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toString()))),
true
);
assert.strictEqual(
isSet(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toLocaleString()))),
true
);
} else {
assert.strictEqual(
isPack(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toString()))),
true
);
assert.strictEqual(
isPack(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toLocaleString()))),
true
);
}

assert.strictEqual(
isPack(locales.map((LANG) => runEnvInside({ LANG, TZ: 'Europe/Zurich' }, () => new Date(333333333333).toString()))),
Expand Down