diff options
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([]); + }); +}); |
