From 055d4c4c39c9c1fcce050019c61caf305ec1a83e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 7 Jun 2024 16:29:32 +0200 Subject: [PATCH] test: add Utils insertAt() test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/utils/Utils.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/utils/Utils.test.ts b/tests/utils/Utils.test.ts index de5b1fd7..11b9973e 100644 --- a/tests/utils/Utils.test.ts +++ b/tests/utils/Utils.test.ts @@ -21,6 +21,7 @@ import { generateUUID, getRandomFloat, hasOwnProp, + insertAt, isArraySorted, isAsyncFunction, isNotEmptyArray, @@ -380,6 +381,11 @@ await describe('Utils test suite', async () => { expect(isNotEmptyArray(new WeakSet())).toBe(false) }) + await it('Verify insertAt()', () => { + expect(insertAt('test', 'ing', 'test'.length)).toBe('testing') + expect(insertAt('test', 'ing', 2)).toBe('teingst') + }) + await it('Verify isArraySorted()', () => { expect( isArraySorted([], (a, b) => { -- 2.34.1