UNPKG

@rxjs-stuff/marbles

Version:

A set of plugins that provide a natural feeling integration with Mocha and Chai for RxJS "marbles" testing.

18 lines 608 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.collectErrors = void 0; const rxjs_1 = require("rxjs"); /** * Operator that collects any errors emitted by the observable and adds them to the specified errors array * @param errors - The array used to collect the errors */ function collectErrors(errors) { return function (source$) { return source$.pipe(rxjs_1.catchError(err => { errors.push(err); return rxjs_1.throwError(err); })); }; } exports.collectErrors = collectErrors; //# sourceMappingURL=collect-errors.js.map