Skip to content

Commit b3f678f

Browse files
committed
test(logo): fix tests broken by upstream logo.js API changes
- Add synth.transport mock in doStopTurtles suite after upstream added transport.isAvailable guard in doStopTurtles - Replace _totalIterations with _iterationBudget in MAX_ITERATIONS test after upstream switched iteration guard to countdown logic Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
1 parent be91333 commit b3f678f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

js/__tests__/logo.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,8 @@ describe("Logo doStopTurtles timer cleanup", () => {
21962196
stop: jest.fn(),
21972197
stopSound: jest.fn(),
21982198
disposeAllInstruments: jest.fn(),
2199-
recorder: null
2199+
recorder: null,
2200+
transport: { isAvailable: false, cancel: jest.fn() }
22002201
};
22012202
logo._restoreConnections = jest.fn();
22022203
});
@@ -2311,7 +2312,7 @@ describe("Logo runFromBlockNow additional coverage", () => {
23112312
});
23122313

23132314
test("stops execution and reports error when MAX_ITERATIONS exceeded", () => {
2314-
logo._totalIterations = logo._MAX_ITERATIONS;
2315+
logo._iterationBudget = 1; // will decrement to 0 on first runFromBlockNow call
23152316
logo.blockList = [
23162317
{
23172318
name: "noop",

0 commit comments

Comments
 (0)