expected-kefir
v1.0.4
Published
This is a universal library for testing observables from [KefirJS](https://github.com/kefirjs/kefir).
Downloads
6
Maintainers
Readme
Expected Kefir
This is a universal library for testing observables from KefirJS.
It assumes that observable ends at expected array end. If a test fails it will throw an Error
.
Install
npm i expected-kefir
Example usage with Mocha
var { expect } = require('expected-kefir');
var kefir = require('kefir');
describe('samle test', function () {
it(`works`, function () {
expect(kefir
.constant([1, 2, 3, 4])
.flatten()
.map(n => n * 2))
.toEmit([2, 4, 6, 8])
})
})
Output
samle test
✔ works
1 passing (14ms)
API
expect(kefirJsObservable)
.toEmit(expectedArrayEmits)
Contributors
Warmly welcome!