Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('Iterable#concat concatAll order of effects', () => {
let i = 0;
const xss = range(0, 3).pipe(
map(x => range(0, x + 1)),
tap({ next: async () => ++i })
);
const res = xss.pipe(
concatAll(),
map(x => i + ' - ' + x)
);
expect(sequenceEqual(res, of('1 - 0', '2 - 0', '2 - 1', '3 - 0', '3 - 1', '3 - 2'))).toBeTruthy();
});
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('Iterable#concat concatAll order of effects', () => {
let i = 0;
const xss = range(0, 3).pipe(
map(x => range(0, x + 1)),
tap({ next: async () => ++i })
);
const res = xss.pipe(
concatAll(),
map(x => i + ' - ' + x)
);
expect(sequenceEqual(res, of('1 - 0', '2 - 0', '2 - 1', '3 - 0', '3 - 1', '3 - 2'))).toBeTruthy();
});
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]);
});
const buffersItr = () => stringsItr().pipe(map(val => Buffer.from(val)));
const objectsItr = () => stringsItr().pipe(map(val => ({ val })));