rx-assert
Helper methods for making asserts in unit tests for rxjs library.
Installation
npm install rx-assert
Description
This package provides a low level api for comparing observable sequences. Can be used in unit tests for comparing observables.
Example of usage with chai
const rxAssert = ; const assert = assert; const Rx = ;const TestScheduler = RxTestScheduler;const onNext = RxReactiveTestonNext;const onError = RxReactiveTestonError;const onCompleted = RxReactiveTestonCompleted;const subscribe = RxReactiveTestsubscribe; ;
Methods
isEqual(actual, expected)
- @param {List} actual List with notification records (onNext(), onCompleted e.t.c)
- @param {List} expected List with notification records (onNext(), onCompleted e.t.c)
- @return {List} List with 2 elements - [isEqual {bool}, diffMessage {String}]
First element defines wether actual and expected sequences are equal.
The second one provides a diff message.
Example:
const xs = scheduler; const results = scheduler; const expected = const equal message = rxAssert;
Dev info
Installation
git clonecdnpm install .
Test coverage
Contributions are welcome. Dont forget to check the tests.
npm test