From df07864fda3d85bec2e5be7d359f16961482a7b7 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 13 Oct 2019 12:25:05 +0200 Subject: [PATCH] use fixed timezone for jest tests --- scm-ui/jest-preset/jest-preset.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scm-ui/jest-preset/jest-preset.js b/scm-ui/jest-preset/jest-preset.js index 7c6189ffed..395e8cb10a 100644 --- a/scm-ui/jest-preset/jest-preset.js +++ b/scm-ui/jest-preset/jest-preset.js @@ -3,6 +3,13 @@ const rootDir = path.resolve(__dirname, ".."); const reportDirectory = path.join(rootDir, "target", "jest-reports"); const mockDirectory = path.resolve(__dirname, "src", "__mocks__"); +// Set timezone for tests, this is required to get same date values +// accross diferent machines such ci-server and dev box. +// We have to set the timezone as soon as possible, because Date will +// cache the value. +// @see https://stackoverflow.com/questions/56261381/how-do-i-set-a-timezone-in-my-jest-config +process.env.TZ = "Europe/Berlin"; + module.exports = { rootDir, transform: {