mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Setting global UTC timezone for tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
194370e020
commit
1a3f7ddd02
@ -76,7 +76,8 @@
|
||||
"ts-jest": {
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"globalSetup": "<rootDir>/src/jest.timezone.ts"
|
||||
},
|
||||
"build": {
|
||||
"generateUpdatesFilesForAllChannels": true,
|
||||
|
||||
12
src/common/__tests__/timezones.test.ts
Normal file
12
src/common/__tests__/timezones.test.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
describe("Timezones", () => {
|
||||
it("should always be UTC", () => {
|
||||
expect(new Date().getTimezoneOffset()).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
export {};
|
||||
11
src/jest.timezone.ts
Normal file
11
src/jest.timezone.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
// Setting the timezone to UTC to ensure same timezone for CI and local environments
|
||||
module.exports = async () => {
|
||||
process.env.TZ = "UTC";
|
||||
};
|
||||
|
||||
export {};
|
||||
Loading…
Reference in New Issue
Block a user