@nknahom/lotide
Version:
Lotide is mini clone of the Lodash (https://lodash.com) library for learning JavaScript. What is Lodash? Lodash is a library that makes JavaScript easier by taking the hassle out of working with arrays, numbers, objects, strings, etc.
21 lines (16 loc) • 479 B
JavaScript
const middle = require("../middle");
const assert = require("chai").assert;
describe("#middle", () => {
it("return [] if for [1]", () => {
assert.deepEqual(middle([1]), []);
});
it("return [1,2] if for []", () => {
assert.deepEqual(middle([1, 2]), []);
});
it("return [1,2,3] if for [2]", () => {
assert.deepEqual(middle([1, 2, 3]), [2]);
});
it("return [1,2,3,4] if for [2,3]", () => {
assert.deepEqual(middle([1, 2, 3, 4]), [2, 3]);
});
});