generateUUID,
getRandomFloat,
hasOwnProp,
+ insertAt,
isArraySorted,
isAsyncFunction,
isNotEmptyArray,
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) => {
- return a - b
- })
- ).toBe(true)
- expect(
- isArraySorted([1], (a, b) => {
- return a - b
- })
- ).toBe(true)
+ expect(isArraySorted<number>([], (a, b) => a - b)).toBe(true)
+ expect(isArraySorted<number>([1], (a, b) => a - b)).toBe(true)
expect(isArraySorted<number>([1, 2, 3, 4, 5], (a, b) => a - b)).toBe(true)
expect(isArraySorted<number>([1, 2, 3, 5, 4], (a, b) => a - b)).toBe(false)
expect(isArraySorted<number>([2, 1, 3, 4, 5], (a, b) => a - b)).toBe(false)