2020-03-02 15:07:20 +00:00
|
|
|
import test from "ava";
|
|
|
|
import { collected } from "../../src/utils";
|
2020-07-04 14:43:52 +00:00
|
|
|
import { strom } from "../../src";
|
|
|
|
const { fromArray, collect } = strom({ objectMode: true });
|
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]);
|
|
|
|
});
|