1.0.4 • Published 4 years ago
expected-kefir v1.0.4
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-kefirExample 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!