diff --git a/test/unit/blocks_music.js b/test/unit/blocks_music.js index 66c950836..b9e3c8afc 100644 --- a/test/unit/blocks_music.js +++ b/test/unit/blocks_music.js @@ -4,7 +4,6 @@ let playedDrum; let playedInstrument; const runtime = { audioEngine: { - numDrums: 3, numInstruments: 3, instrumentPlayer: { loadInstrument: instrument => (playedInstrument = instrument) @@ -12,13 +11,14 @@ const runtime = { } }; const blocks = new Music(runtime); +blocks._playDrumNum = (util, drum) => (playedDrum = drum); + const util = { + stackFrame: Object.create(null), target: { - audioPlayer: { - playDrumForBeats: drum => (playedDrum = drum) - } + audioPlayer: null }, - stackFrame: Object.create(null) + yield: () => null }; test('playDrum uses 1-indexing and wrap clamps', t => { @@ -26,7 +26,7 @@ test('playDrum uses 1-indexing and wrap clamps', t => { blocks.playDrumForBeats(args, util); t.strictEqual(playedDrum, 0); - args = {DRUM: runtime.audioEngine.numDrums + 1}; + args = {DRUM: blocks.DRUM_INFO.length + 1}; blocks.playDrumForBeats(args, util); t.strictEqual(playedDrum, 0);