UNPKG

biodome

Version:

Home automation you can live with

18 lines (16 loc) 503 B
import chai from 'chai'; import sinon from 'sinon'; import EventEmitter from 'eventemitter3'; import commandStream from '../../lib/commandStream'; describe('commandStream', function() { it('provides command events as stream', function() { const events = new EventEmitter(); const stream = commandStream(events); const spy = sinon.spy(); stream.observe(spy); process.nextTick(() => { events.emit('command', 'foo'); chai.expect(spy.called).to.be.true; }); }); });