Add unit test for isUndefined()
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 27 Oct 2022 09:02:36 +0000 (11:02 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 27 Oct 2022 09:02:36 +0000 (11:02 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
test/utils/UtilsTest.ts

index cb8b5d0893d86e0402e5afbfaa4bcfabc97346d7..705225b0398081c4dd09dcdf2b08232a991b797d 100644 (file)
@@ -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);