use fixed timezone for jest tests

This commit is contained in:
Sebastian Sdorra
2019-10-13 12:25:05 +02:00
parent b0dffa95e3
commit df07864fda

View File

@@ -3,6 +3,13 @@ const rootDir = path.resolve(__dirname, "..");
const reportDirectory = path.join(rootDir, "target", "jest-reports"); const reportDirectory = path.join(rootDir, "target", "jest-reports");
const mockDirectory = path.resolve(__dirname, "src", "__mocks__"); 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 = { module.exports = {
rootDir, rootDir,
transform: { transform: {