From: Jérôme Benoit Date: Thu, 27 Oct 2022 09:02:36 +0000 (+0200) Subject: Add unit test for isUndefined() X-Git-Tag: v1.1.87~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=429f8c9d472e04611466b56448f64af12e1dabcc;p=e-mobility-charging-stations-simulator.git Add unit test for isUndefined() Signed-off-by: Jérôme Benoit --- diff --git a/test/utils/UtilsTest.ts b/test/utils/UtilsTest.ts index cb8b5d08..705225b0 100644 --- a/test/utils/UtilsTest.ts +++ b/test/utils/UtilsTest.ts @@ -89,6 +89,19 @@ describe('Utils test suite', () => { expect(Utils.isEmptyString(new WeakSet())).toBe(false); }); + it('Verify isUndefined()', () => { + expect(Utils.isUndefined(undefined)).toBe(true); + expect(Utils.isUndefined(null)).toBe(false); + expect(Utils.isUndefined('')).toBe(false); + expect(Utils.isUndefined(0)).toBe(false); + expect(Utils.isUndefined({})).toBe(false); + expect(Utils.isUndefined([])).toBe(false); + expect(Utils.isUndefined(new Map())).toBe(false); + expect(Utils.isUndefined(new Set())).toBe(false); + expect(Utils.isUndefined(new WeakMap())).toBe(false); + expect(Utils.isUndefined(new WeakSet())).toBe(false); + }); + it('Verify isNullOrUndefined()', () => { expect(Utils.isNullOrUndefined(null)).toBe(true); expect(Utils.isNullOrUndefined(undefined)).toBe(true);