fix: force timezone to be UTC for tests (#38215)
react-calendar-heatmap's output depends on the timezone, which means that snapshots can fail if the timezone changes. This sets the timezone as UTC during client tests to avoid that problem.pull/38217/head
parent
701bbc2ae9
commit
cc79999a31
|
@ -0,0 +1,3 @@
|
|||
module.exports = async () => {
|
||||
process.env.TZ = 'UTC';
|
||||
};
|
|
@ -12,6 +12,7 @@ module.exports = {
|
|||
globals: {
|
||||
__PATH_PREFIX__: ''
|
||||
},
|
||||
globalSetup: './jest-timezone-setup.js',
|
||||
verbose: true,
|
||||
transform: {
|
||||
'^.+\\.js$': '<rootDir>/jest.transform.js'
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
/* global expect */
|
||||
describe('Timezones', () => {
|
||||
it('should always be UTC', () => {
|
||||
expect(new Date().getTimezoneOffset()).toBe(0);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue