Skip to content

Commit 144b15d

Browse files
committed
Mock timers to avoid failures from delayed calls to setInterval
1 parent b5c553c commit 144b15d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/unit/oceans/ui.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,10 @@ describe('Pond', () => {
608608
});
609609

610610
describe('Guide', () => {
611-
let currentGuideStub, playSoundStub;
611+
let clock, currentGuideStub, playSoundStub;
612612

613613
beforeEach(() => {
614+
clock = sinon.useFakeTimers();
614615
currentGuideStub = sinon.stub(guide, 'getCurrentGuide');
615616
currentGuideStub.returns({
616617
id: 'guide-id',
@@ -622,6 +623,7 @@ describe('Guide', () => {
622623
});
623624

624625
afterEach(() => {
626+
clock.restore();
625627
guide.getCurrentGuide.restore();
626628
soundLibrary.playSound.restore();
627629
});

0 commit comments

Comments
 (0)