mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
Fix timezone mismatch in server tests (#1918)
This commit is contained in:
parent
87d84b922f
commit
82e8cd0f8d
@ -3,6 +3,12 @@
|
||||
import { timeUtils } from './time-utils';
|
||||
|
||||
describe('Time Utilities', () => {
|
||||
describe('timezone', () => {
|
||||
it('should always be UTC', () => {
|
||||
expect(new Date().getTimezoneOffset()).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('checkValidTimestamp', () => {
|
||||
it('check for year 0000', () => {
|
||||
const result = timeUtils.checkValidTimestamp('0000-00-00T00:00:00.000Z');
|
||||
|
3
server/libs/domain/test/global-setup.js
Normal file
3
server/libs/domain/test/global-setup.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = async () => {
|
||||
process.env.TZ = 'UTC';
|
||||
};
|
@ -160,6 +160,7 @@
|
||||
"@app/common": "<rootDir>/libs/common/src",
|
||||
"^@app/infra(|/.*)$": "<rootDir>/libs/infra/src/$1",
|
||||
"^@app/domain(|/.*)$": "<rootDir>/libs/domain/src/$1"
|
||||
}
|
||||
},
|
||||
"globalSetup": "<rootDir>/libs/domain/test/global-setup.js"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user