arb-convert
Version:
Convert Application Resource Bundle (ARB) translation files to other translation formats and back
12 lines (10 loc) • 337 B
text/typescript
const helpers = {
mockDateNow: (date?: Date) => {
// 2019-12-31T16:00:00.000Z
const DEFAULT_NOW = 1577808000000;
const now = date ? date.getTime() : DEFAULT_NOW;
const spy = jest.spyOn(Date, 'now').mockImplementation(() => now);
return { now, spy };
},
};
Object.assign(global, helpers);