diff --git a/lib/modules/console/index.js b/lib/modules/console/index.js index 97fa303b..208b389a 100644 --- a/lib/modules/console/index.js +++ b/lib/modules/console/index.js @@ -77,7 +77,7 @@ class Console { this.events.emit('runcode:register', 'Web3', Web3, false); this.events.emit('runcode:register', 'EmbarkJS', EmbarkJS, false); - this.events.on('code-generator-ready', () => { + this.events.once('code-generator-ready', () => { if (this.ipc.connected) { return; } diff --git a/test/console.js b/test/console.js index dac075a7..f02d4a99 100644 --- a/test/console.js +++ b/test/console.js @@ -8,7 +8,7 @@ let version = require('../package.json').version; describe('embark.Console', function() { let ipc = new IPC({ipcRole: 'none'}); let plugins = new Plugins({plugins: {}}); - let events = {on: () => {}, setCommandHandler: () => {}, emit: () => {}}; + let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}}; let console = new Console({}, {plugins, version, ipc, events}); describe('#executeCmd', function() {