diff --git a/test/parallel/test-process-env-tz.js b/test/parallel/test-process-env-tz.js index da716299c9f622..b0188ab9c267f8 100644 --- a/test/parallel/test-process-env-tz.js +++ b/test/parallel/test-process-env-tz.js @@ -31,19 +31,19 @@ if (date.toString().includes('(Central European Time)') || common.skip('tzdata too old'); } -assert.strictEqual( - date.toString().replace('Central European Summer Time', 'CEST'), - 'Sat Apr 14 2018 14:34:56 GMT+0200 (CEST)'); +assert.match( + date.toString(), + /^Sat Apr 14 2018 14:34:56 GMT\+0200 \(.+\)$/); process.env.TZ = 'Europe/London'; -assert.strictEqual( - date.toString().replace('British Summer Time', 'BST'), - 'Sat Apr 14 2018 13:34:56 GMT+0100 (BST)'); +assert.match( + date.toString(), + /^Sat Apr 14 2018 13:34:56 GMT\+0100 \(.+\)$/); process.env.TZ = 'Etc/UTC'; -assert.strictEqual( - date.toString().replace('Coordinated Universal Time', 'UTC'), - 'Sat Apr 14 2018 12:34:56 GMT+0000 (UTC)'); +assert.match( + date.toString(), + /^Sat Apr 14 2018 12:34:56 GMT\+0000 \(.+\)$/); // Just check that deleting the environment variable doesn't crash the process. // We can't really check the result of date.toString() because we don't know