axax
Version:
A library of async iterator extensions for JavaScript including ```map```, ```reduce```, ```filter```, ```flatMap```, ```pipe``` and [more](https://github.com/jamiemccrindle/axax/blob/master/docs/API.md#functions).
22 lines (21 loc) • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const of_1 = require("../of");
const toArray_1 = require("../toArray");
const zip_1 = require("../zip");
test("zip", async () => {
const result = await toArray_1.toArray(zip_1.zip(of_1.of(1, 3, 5))(of_1.of(2, 4, 6)));
expect(result).toEqual([[1, 2], [3, 4], [5, 6]]);
});
test("zip with empty iterable", async () => {
const result = await toArray_1.toArray(zip_1.zip(of_1.of(1, 3, 5))(of_1.of()));
expect(result).toEqual([]);
});
test("zip empty iterable", async () => {
const result = await toArray_1.toArray(zip_1.zip(of_1.of())(of_1.of(2, 4, 6)));
expect(result).toEqual([]);
});
test("zip different lengths", async () => {
const result = await toArray_1.toArray(zip_1.zip(of_1.of(1, 3, 5))(of_1.of(2, 4)));
expect(result).toEqual([[1, 2], [3, 4]]);
});