strom/tests/utils/collected.spec.ts

9 lines
308 B
TypeScript
Raw Normal View History

2020-03-02 15:07:20 +00:00
import test from "ava";
import { collected } from "../../src/utils";
import { fromArray, collect } from "../../src";
2020-03-02 15:07:20 +00:00
test("collected returns a promise for the first data point", async t => {
const data = collected(fromArray([1, 2, 3, 4]).pipe(collect()));
t.deepEqual(await data, [1, 2, 3, 4]);
});