isNullOrUndefined,
isObject,
isUndefined,
+ isValidDate,
roundTo,
secureRandom,
sleep,
expect(end - start).toBeGreaterThanOrEqual(1000);
});
+ it('Verify isValidDate()', () => {
+ expect(isValidDate(undefined)).toBe(false);
+ expect(isValidDate(null)).toBe(false);
+ expect(isValidDate('')).toBe(false);
+ expect(isValidDate({})).toBe(false);
+ expect(isValidDate([])).toBe(false);
+ expect(isValidDate(new Map())).toBe(false);
+ expect(isValidDate(new Set())).toBe(false);
+ expect(isValidDate(new WeakMap())).toBe(false);
+ expect(isValidDate(new WeakSet())).toBe(false);
+ expect(isValidDate(-1)).toBe(true);
+ expect(isValidDate(0)).toBe(true);
+ expect(isValidDate(1)).toBe(true);
+ expect(isValidDate(-0.5)).toBe(true);
+ expect(isValidDate(0.5)).toBe(true);
+ expect(isValidDate(new Date())).toBe(true);
+ });
+
it('Verify convertToDate()', () => {
expect(convertToDate(undefined)).toBe(undefined);
expect(convertToDate(null)).toBe(null);