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.

26 lines (19 loc) 850 B
// test/countLettersTest.js const assert = require('chai').assert; const countLetters = require('../countLetters'); const assertObjectsEqual = require('../assertObjectsEqual'); // TEST CODE describe("countLetters.js test---", () => { it("Should return True 'LHL' === { L: 2, H: 1 }", () => { assert.isTrue(assertObjectsEqual(countLetters("LHL"), { L: 2, H: 1 })); }); it("Should return True 'test' === { t: 2, e: 1, s: 1 }", () => { assert.isTrue(assertObjectsEqual(countLetters("test"), { t: 2, e: 1, s: 1 })); }); it("Should return False 'LHL' !== { L: 2, H: 0 }", () => { assert.isFalse(assertObjectsEqual(countLetters("LHL"), { L: 2, H: 0 })); }); it("Should return True 'test' === { t: 2, e: 2, s: 1 }", () => { assert.isFalse(assertObjectsEqual(countLetters("test"), { t: 2, e: 2, s: 1 })); }); });