mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed Date.now() use in email analytics unit tests (#21188)
no ref We had an instance where this was a ms off and I should've used mock timers when I first wrote this. This should prevent any rare clock mishaps.
This commit is contained in:
parent
851ec7eb0b
commit
c26aacacf5
1 changed files with 10 additions and 0 deletions
|
@ -10,6 +10,16 @@ const {
|
|||
const EventProcessingResult = require('../lib/EventProcessingResult');
|
||||
|
||||
describe('EmailAnalyticsService', function () {
|
||||
let clock;
|
||||
|
||||
beforeEach(function () {
|
||||
clock = sinon.useFakeTimers(new Date(2024, 0, 1));
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
clock.restore();
|
||||
});
|
||||
|
||||
describe('getStatus', function () {
|
||||
it('returns status object', function () {
|
||||
// these are null because we're not running them before calling this
|
||||
|
|
Loading…
Reference in a new issue