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:
parent
94f5ad60c3
commit
80ebd1c5be
1 changed files with 4 additions and 1 deletions
|
@ -158,7 +158,10 @@ describe('Milestones Service', function () {
|
||||||
loggingStub = sinon.stub(logging, 'info');
|
loggingStub = sinon.stub(logging, 'info');
|
||||||
const threeMonthsAgo = new Date();
|
const threeMonthsAgo = new Date();
|
||||||
threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
|
threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
|
||||||
clock = sinon.useFakeTimers(threeMonthsAgo.getTime());
|
clock = sinon.useFakeTimers({
|
||||||
|
now: threeMonthsAgo.getTime(),
|
||||||
|
toFake: ['setTimeout']
|
||||||
|
});
|
||||||
sinon.createSandbox();
|
sinon.createSandbox();
|
||||||
configUtils.set('milestones', milestonesConfig);
|
configUtils.set('milestones', milestonesConfig);
|
||||||
mockManager.mockLabsEnabled('milestoneEmails');
|
mockManager.mockLabsEnabled('milestoneEmails');
|
||||||
|
|
Loading…
Add table
Reference in a new issue