From 666674327f009e9b1013218fc384f193b64c6997 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 14 Dec 2025 22:39:18 -0800 Subject: Adds unit tests --- tst/prepend.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tst/prepend.test.ts (limited to 'tst/prepend.test.ts') diff --git a/tst/prepend.test.ts b/tst/prepend.test.ts new file mode 100644 index 0000000..19a9b9a --- /dev/null +++ b/tst/prepend.test.ts @@ -0,0 +1,15 @@ +import { prependWith } from '../lib/index'; + +describe('leftpadesque/prepend', () => { + test('prepends between elements', () => { + expect(prependWith(['a', 'b'], '--')).toEqual(['--', 'a', '--', 'b']); + }); + + test('handles single element', () => { + expect(prependWith(['a'], '--')).toEqual(['--', 'a']); + }); + + test('handles empty input', () => { + expect(prependWith([], '--')).toEqual([]); + }); +}); -- cgit v1.2.3-70-g09d2