strom/tests/compose.spec.ts

21 lines
454 B
TypeScript
Raw Normal View History

2019-08-21 19:40:19 +00:00
const test = require("ava");
const { compose, map } = require("../src");
test.cb("compose()", t => {
const first = map((chunk: number) => chunk * 2);
const second = map((chunk: number) => chunk + 1);
const composed = compose(
[first, second],
{ objectMode: true },
);
composed.write(1);
composed.write(2);
composed.write(3);
composed.on("data", data => {
console.log("DATA", data);
});
});