pragmatic-fp-ts
Version:
Opinionated functional programming library with easy use in mind
13 lines (10 loc) • 350 B
text/typescript
import { intersperse } from "../main.ts";
describe("intersperse()", () => {
it("intersperses collections", () => {
expect(intersperse("a", ["b", "n", "n", "s"]).join("")).toEqual("bananas");
});
it("handles corner cases", () => {
expect(intersperse("a", ["b"])).toEqual(["b"]);
expect(intersperse("a", [])).toEqual([]);
});
});