chore(backstage-cli): Set global jest timezone to UTC

Signed-off-by: Harry Hogg <hhogg@spotify.com>
This commit is contained in:
Harry Hogg
2021-09-13 10:35:32 +01:00
parent 4e4daf3c74
commit 90648a3f60
+7
View File
@@ -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);
};