Chai Assertions for RxJS Observables
ChaiRx extends Chai with a simple utility method emit
for testing emits from an RxJS Observable stream using the Rx.TestScheduler
.
;;; chai; const onNext onCompleted = RxReactiveTest;const scheduler = ; const xs = scheduler; // Note we'll start at 200 for subscribe, hence missing the 150 markconst output = scheduler; to;
Usage
expect
/ should
syntax
const xs = scheduler;const output = scheduler; // expectto; // shouldoutputshould;
Language chains
const const xs = scheduler;const output = scheduler; // with `not`tonot;
Installation
npm install chai-rx
ES6 Imports
;; chai;
AMD
var chai = ;var chaiRx = ; chai;
<script>
tag
If you include ChaiRx directly with a <script>
tag, after the one for Chai itself, then it will automatically plug in to Chai and be ready for use: