UNPKG

sflow

Version:

sflow is a powerful and highly-extensible library designed for processing and manipulating streams of data effortlessly. Inspired by the functional programming paradigm, it provides a rich set of utilities for transforming streams, including chunking, fil

16 lines (13 loc) 439 B
import { it, expect } from "bun:test"; import { emptyStream } from "./emptyStream"; import { sflow } from "./sflow"; it("emptyStream produces no items", async () => { const result = await sflow(emptyStream()).toArray(); expect(result).toEqual([]); }); it("emptyStream closes immediately", async () => { const s = emptyStream(); const reader = s.getReader(); const { done } = await reader.read(); expect(done).toBe(true); });