diff --git a/lib/twoSumHashTable/twoSumHashTable.test.ts b/lib/twoSumHashTable/twoSumHashTable.test.ts index aad31e4..605e1a7 100644 --- a/lib/twoSumHashTable/twoSumHashTable.test.ts +++ b/lib/twoSumHashTable/twoSumHashTable.test.ts @@ -2,13 +2,17 @@ import { describe, it, expect } from "vitest"; import { twoSumHashTable } from "./twoSumHashTable.ts"; describe("twoSumHashTable", () => { - let sortedArray = [-12, 1, 4, 6, 22]; - it("twoSumHashTable", () => { - expect(twoSumHashTable(sortedArray, 4)).toBe(2); + it("[2,7,11,15], 9 => [0, 1]", () => { + expect(twoSumHashTable([2, 7, 11, 15], 9)).toEqual([0, 1]); }); - it("twoSumHashTable", () => { - expect(twoSumHashTable(sortedArray, 3)).toBe(-1); + it("[3,2,4], 6 => [1, 2]", () => { + expect(twoSumHashTable([3, 2, 4], 6)).toEqual([1, 2]); }); + + it("[3, 3], 6 => [0, 1]", () => { + expect(twoSumHashTable([3, 3], 6)).toEqual([0, 1]); + }); + });