Fix runtime scope and unit test

This commit is contained in:
Eric Rosenbaum 2018-04-05 15:01:52 -04:00
parent 88b13e218d
commit 2a90e5868d
2 changed files with 3 additions and 2 deletions

View file

@ -76,7 +76,7 @@ class Scratch3MusicBlocks {
this._loadAllSounds();
this._onTargetCreated = this._onTargetCreated.bind(this);
runtime.on('targetWasCreated', this._onTargetCreated);
this.runtime.on('targetWasCreated', this._onTargetCreated);
}
/**

View file

@ -2,7 +2,8 @@ const test = require('tap').test;
const Music = require('../../src/extensions/scratch3_music/index.js');
const fakeRuntime = {
getTargetForStage: () => ({tempo: 60})
getTargetForStage: () => ({tempo: 60}),
on: () => {} // Stub out listener methods used in constructor.
};
const blocks = new Music(fakeRuntime);