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

25 lines (21 loc) 625 B
import { sf } from "."; import { sfTemplate } from "./sfTemplate"; it("works", async () => { expect(await sfTemplate`hello ${sf("asdf")} zxcv`.text()).toBe( "hello asdf zxcv" ); }); it("multi", async () => { expect( await sfTemplate`hello ${sf("asdf")} ${sf("asdf")} ${sf( "asdf" )} zxcv`.text() ).toBe("hello asdf asdf asdf zxcv"); }); it("nest", async () => { expect( await sfTemplate`hello ${await sfTemplate`nested ${sf("stream1")} ${sf( "stream2" )} ${sf("stream3")} zxcv`.text()} ${sf("asdf")} end`.text() ).toBe("hello nested stream1 stream2 stream3 zxcv asdf end"); });