UNPKG

@ahsolo/lotide

Version:

lotide assignment for Lighthouse Labs coding bootcamp

25 lines (23 loc) 675 B
const assert = require("chai").assert; const letterPositions = require("../letterPositions"); // Test Case const obj = { l: [0], i: [1, 11], g: [2], h: [3, 5, 15, 18], t: [4, 14], o: [6, 19], u: [7, 20], s: [8, 21], e: [9, 16, 22], n: [12] } describe("#letterPositions", () => { it("should return [3, 5, 15, 18] in the 'h' key when called with 'lighthouse in the house'", () => { assert.deepEqual(letterPositions("lighthouse in the house")["h"], obj["h"]); }); it("should return [12] in the 'n' key when called with 'lighthouse in the house'", () => { assert.deepEqual(letterPositions("lighthouse in the house")["n"], obj["n"]); }); });