From 429f8c9d472e04611466b56448f64af12e1dabcc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 27 Oct 2022 11:02:36 +0200 Subject: [PATCH] Add unit test for isUndefined() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- test/utils/UtilsTest.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); -- 2.34.1