TimeZone in Jest
TZ=UTC jest --config=jest.config.jslet config = {
... ...
// A path to a module which exports an async function that is triggered once before all test suites
globalSetup: "<rootDir>/global-setup.js",
... ...
}
module.exports = configmodule.exports = async () => {
process.env.TZ = "Asia/Shanghai";
};
Last updated