@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.
49 lines (44 loc) • 943 B
JavaScript
const assert = require("chai").assert;
const countOnly = require("../countOnly");
describe("#countOnly", () => {
it('it should return 1 for ["Jason"]', () => {
const firstNames = [
"Karl",
"Salima",
"Agouhanna",
"Fang",
"Kavith",
"Jason",
"Salima",
"Fang",
"Joe",
];
const result1 = countOnly(firstNames, {
Jason: true,
Karima: true,
Fang: true,
Agouhanna: false,
});
assert.strictEqual(result1["Jason"], 1);
});
it('it should return undefined for ["Karima"]', () => {
const firstNames = [
"Karl",
"Salima",
"Agouhanna",
"Fang",
"Kavith",
"Jason",
"Salima",
"Fang",
"Joe",
];
const result1 = countOnly(firstNames, {
Jason: true,
Karima: true,
Fang: true,
Agouhanna: false,
});
assert.strictEqual(result1["Karima"], undefined);
});
});