Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test(`#pipe type inference is correct with two operators`, () => {
const source = of(0, 1, 2).pipe(
map(x => x + 1),
map(x => x + 1)
);
expect(source).toEqualStream([2, 3, 4]);
});
test(`#pipeThrough type inference is correct with writable stream`, () => {
const source = of(0, 1, 2).pipeThrough(new TransformStream());
expect(source).toEqualStream([0, 1, 2]);
});
test(`#pipeThrough type inference is correct with writable stream and pipe options`, () => {
test(`#pipe type inference is correct with writable stream and pipe options`, () => {
const source = of(0, 1, 2).pipe(
new PassThrough({ objectMode: true }),
{ end: true }
);
expect(source).toEqualStream([0, 1, 2]);
});
}
test('Iterable#concat concatAll behavior', () => {
const res = of(of(1, 2, 3), of(4, 5)).pipe(concatAll());
expect(sequenceEqual(res, of(1, 2, 3, 4, 5))).toBeTruthy();
});
test('Iterable#concat concatAll behavior', () => {
const res = of(of(1, 2, 3), of(4, 5)).pipe(concatAll());
expect(sequenceEqual(res, of(1, 2, 3, 4, 5))).toBeTruthy();
});
const res = xs.pipe(catchError((_: Error) => of('foo')));
expect(sequenceEqual(res, xs)).toBeTruthy();
const res = xs.pipe(catchError((_: Error) => of(42)));
expect(sequenceEqual(res, xs)).toBeTruthy();
const res = xs.pipe(catchError(_ => of(42)));
expect(sequenceEqual(res, xs)).toBeTruthy();