Skip to content

Commit fc2218f

Browse files
committed
feat: test file of 3Sum algorithm
1 parent 782e1ee commit fc2218f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/_Problems_/3Sum/3sum.test.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const threeSum = require("./3sum");
2+
3+
describe("threeSum", () => {
4+
it("Should return [[-1, -1, 2], [-1, 0, 1]]", () => {
5+
expect(threeSum([-1, 0, 1, 2, -1, -4])).toEqual([
6+
[-1, -1, 2],
7+
[-1, 0, 1],
8+
]);
9+
});
10+
11+
it("Should return [[0, 0, 0]]", () => {
12+
expect(threeSum([0, 0, 0])).toEqual([[0, 0, 0]]);
13+
});
14+
15+
it("Should return [[-1, -1, 2]]", () => {
16+
expect(threeSum([-1, 2, -1, -4])).toEqual([[-1, -1, 2]]);
17+
});
18+
19+
});

0 commit comments

Comments
 (0)