Adding collected

This commit is contained in:
Lewis Diamond
2020-03-02 10:07:20 -05:00
parent 2841f4e182
commit ed73bd2887
10 changed files with 75 additions and 50 deletions

View File

@@ -0,0 +1,9 @@
import test from "ava";
import { collected } from "../../src/utils";
import mhysa from "../../src";
const { fromArray, collect } = mhysa({ objectMode: true });
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]);
});