Skip to content

Commit f6408ff

Browse files
authoredJan 30, 2020
Add test cases mentioned in trekhleb#308
1 parent 3b9a358 commit f6408ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/algorithms/sets/combination-sum/__test__/combinationSum.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import combinationSum from '../combinationSum';
22

33
describe('combinationSum', () => {
44
it('should find all combinations with specific sum', () => {
5+
expect(combinationSum([1], 100000)).toHaveLength(1);
6+
7+
expect(
8+
combinationSum([1], 100000)[0]
9+
.every(el => el === 1),
10+
)
11+
.toBe(true);
12+
13+
expect(combinationSum([0, 2], 6)).toEqual([[2, 2, 2]]);
14+
515
expect(combinationSum([1], 4)).toEqual([
616
[1, 1, 1, 1],
717
]);

0 commit comments

Comments
 (0)
Please sign in to comment.