0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed random timeouts in milestone service e2e test

no issue

- Passed specific config to `useFakeTimers` so the test only fakes the `setTimeout` call
This commit is contained in:
Aileen Nowak 2023-02-22 19:54:49 +02:00 committed by Aileen Booker
parent 94f5ad60c3
commit 80ebd1c5be

View file

@ -158,7 +158,10 @@ describe('Milestones Service', function () {
loggingStub = sinon.stub(logging, 'info');
const threeMonthsAgo = new Date();
threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
clock = sinon.useFakeTimers(threeMonthsAgo.getTime());
clock = sinon.useFakeTimers({
now: threeMonthsAgo.getTime(),
toFake: ['setTimeout']
});
sinon.createSandbox();
configUtils.set('milestones', milestonesConfig);
mockManager.mockLabsEnabled('milestoneEmails');