78521fe11 days ago17 lines · 563 B| 1 | import { expect, test } from "bun:test"; |
| 2 | |
| 3 | import { chunkBySize } |
| 4 | |
| 5 | test("keeps order and splits once a chunk would pass the limit", () |
| 6 | const [a, |
| 7 | expect(chunkBySize([a |
| 8 | }); |
| 9 | |
| 10 | test("sends an item larger than the limit on its own", () |
| 11 | const big = |
| 12 | expect(chunkBySize(["a |
| 13 | }); |
| 14 | |
| 15 | test("returns nothing for nothing", () |
| 16 | expect(chunkBySize([], |
| 17 | }); |