UNPKG

@mattseligman/lotide

Version:

Lotide is a mini clone of the Lodash Library to practice crating a personal npm package. It's like lodash, but without all that extra stuff. Just the things you need to start your project.

19 lines (14 loc) 571 B
const assert = require('chai').assert; const flatten = require('../flatten'); // TEST CODE describe("flatten.js test---", () => { it("Should return True [1,2,3] === [1,2,3]", () => { assert.deepEqual(flatten([1, 2, [3, 4], 5, [6]]), [1, 2, 3, 4, 5, 6]); }); it("Should return True (Recursive test) [1, [1,[2,3]], [3]] === [1, 1, 2, 3, 3]", () => { assert.deepEqual(flatten([1, [1,[2,3]], [3]]), [ 1, 1, 2, 3, 3 ]); }); it("Should return False [1, 2, [3]] === [1, 2, 3]", () => { assert.deepEqual(flatten([1, 2, [3]]), [1, 2, 3]); }); });