diff --git a/webapp/packages/core-cli/tests/test.environment.js b/webapp/packages/core-cli/tests/test.environment.js index 407fcdb17b..bd7ec944f4 100644 --- a/webapp/packages/core-cli/tests/test.environment.js +++ b/webapp/packages/core-cli/tests/test.environment.js @@ -12,5 +12,8 @@ module.exports = class CustomTestEnvironment extends Environment { this.global.TextDecoder = TextDecoder; this.global.Response = Response; this.global.Request = Request; + + // different machine has its own timezones and some tests can fail because of it + process.env.TZ = 'UTC'; } -}; \ No newline at end of file +}; diff --git a/webapp/packages/core-utils/src/timestampToDate.test.ts b/webapp/packages/core-utils/src/timestampToDate.test.ts index b8a30001b7..80b307c5da 100644 --- a/webapp/packages/core-utils/src/timestampToDate.test.ts +++ b/webapp/packages/core-utils/src/timestampToDate.test.ts @@ -3,16 +3,16 @@ import { timestampToDate } from './timestampToDate'; describe('timestampToDate', () => { it('should convert timestamp to date', () => { const date = timestampToDate(1591862400000); - expect(date).toBe('6/11/2020, 10:00:00 AM'); + expect(date).toBe('6/11/2020, 8:00:00 AM'); }); it('should convert negative timestamp to date', () => { const date = timestampToDate(-1591862400000); - expect(date).toBe('7/23/1919, 5:00:00 PM'); + expect(date).toBe('7/23/1919, 4:00:00 PM'); }); it('should convert zero timestamp to date', () => { const date = timestampToDate(0); - expect(date).toBe('1/1/1970, 1:00:00 AM'); + expect(date).toBe('1/1/1970, 12:00:00 AM'); }); });