diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-12-14 22:39:18 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-12-14 22:39:18 -0800 |
| commit | 666674327f009e9b1013218fc384f193b64c6997 (patch) | |
| tree | acebae7b425b469584eb0a5bec396899c2739501 /tst/prepend.test.ts | |
| parent | 594ce452693a71b501d3aff3f35ef3732c06c341 (diff) | |
| download | pengueno-666674327f009e9b1013218fc384f193b64c6997.tar.gz pengueno-666674327f009e9b1013218fc384f193b64c6997.zip | |
Adds unit tests
Diffstat (limited to 'tst/prepend.test.ts')
| -rw-r--r-- | tst/prepend.test.ts | 15 |
1 files changed, 15 insertions, 0 deletions
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([]); + }); +}); |
