Example #1
0
 it("does not filter non-undefineds", () => {
   const testArray = [0, 1, "a", {}, false, null, NaN];
   expect(removeUndefined(testArray)).to.eql(testArray);
 });
Example #2
0
 it("filters out undefineds", () => {
   const testArray = [undefined, 0, undefined, {}, false, null, NaN, undefined];
   const expectedArray = [0, {}, false, null, NaN];
   expect(removeUndefined(testArray)).to.eql(expectedArray);
 });
Example #3
0
 it("handles empty array", () => {
   expect(removeUndefined([])).to.eql([]);
 });