From 3177476850137ca3024fc6dde6c3e8789875374e Mon Sep 17 00:00:00 2001 From: Ismail Cherri Date: Fri, 16 Aug 2024 16:59:51 +0300 Subject: [PATCH] SONAR-22804 Add a unified jest timezone configuration --- server/sonar-web/config/jest/GlobalSetup.js | 22 +++++++++++++++++++++ server/sonar-web/jest.config.js | 1 + 2 files changed, 23 insertions(+) create mode 100644 server/sonar-web/config/jest/GlobalSetup.js diff --git a/server/sonar-web/config/jest/GlobalSetup.js b/server/sonar-web/config/jest/GlobalSetup.js new file mode 100644 index 00000000000..156fd1ef94e --- /dev/null +++ b/server/sonar-web/config/jest/GlobalSetup.js @@ -0,0 +1,22 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +module.exports = () => { + process.env.TZ = 'utc'; +}; diff --git a/server/sonar-web/jest.config.js b/server/sonar-web/jest.config.js index 22bb1268040..c4ddb33a975 100644 --- a/server/sonar-web/jest.config.js +++ b/server/sonar-web/jest.config.js @@ -28,6 +28,7 @@ module.exports = { '^~sonar-aligned/(.*)': '/src/main/js/sonar-aligned/$1', '^.+\\.css$': '/config/jest/CSSStub.js', }, + globalSetup: '/config/jest/GlobalSetup.js', setupFiles: [ '/config/polyfills.ts', '/config/jest/SetupTestEnvironment.ts', -- 2.39.5