diff --git a/packages/cli/src/commands/testCommand.ts b/packages/cli/src/commands/testCommand.ts index d885e1aec9..24a4e06f9e 100644 --- a/packages/cli/src/commands/testCommand.ts +++ b/packages/cli/src/commands/testCommand.ts @@ -63,6 +63,13 @@ export default async (cmd: Command) => { (process.env as any).NODE_ENV = 'test'; } + // This is to have a consistent timezone for when running tests that involve checking + // the formatting of date/times. + // https://stackoverflow.com/questions/56261381/how-do-i-set-a-timezone-in-my-jest-config + if (!process.env.TZ) { + process.env.TZ = 'UTC'; + } + // eslint-disable-next-line jest/no-jest-import await require('jest').run(args); };