expected-kefir

1.0.4 • Public • Published

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!

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    1
    • latest

Version History

Package Sidebar

Install

npm i expected-kefir

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

3.44 kB

Total Files

4

Last publish

Collaborators

  • episage