redux-saga-assert
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

redux-saga-assert

Various helpers for testing your redux-sagas.

Wrap your saga in the assertSaga(yourSaga) call and then use the fluent syntax to perform various assertions on its behaviour.

justRespondsToLeading / justRespondsToLatest / justRespondsToEvery - assert that the tested saga responds to the leading (/latest, /every) action (or actions) with the specified handler and does absolutely nothing else. The actions in the assert (and the actual watcher saga) can be in any order.

justSpawnsAsync - assert that the tested saga spawns the specified sagas (in any order) and does absolutely nothing else (no puts, no calls, no forks).

Current limitations

You have to use the typesafe-actions library for the asserts to work correctly, as they make use of the library-specific getType() function (it operates on action creators, returning their returned action type string).

Major contributors

Anton Chistov – a.chistov@protoware.com

/redux-saga-assert/

    Package Sidebar

    Install

    npm i redux-saga-assert

    Weekly Downloads

    28

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    22.7 kB

    Total Files

    10

    Last publish

    Collaborators

    • pkabirr