Files
JavaScript/Backtracking/tests/AllCombinationsOfSizeK.test.js
Rahul Bhandari cafb3433e8 Update AllCombinationsOfSizeK.js (#1530)
* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.test.js

Changes made it the type of testing. 
Instead of testing the class now the program will test the function

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.test.js

* Update AllCombinationsOfSizeK.test.js
2023-10-30 11:10:02 +05:30

25 lines
539 B
JavaScript

import { generateCombinations } from '../AllCombinationsOfSizeK'
describe('AllCombinationsOfSizeK', () => {
it('should return 3x2 matrix solution for n = 3 and k = 2', () => {
const res = generateCombinations(3, 2)
expect(res).toEqual([
[1, 2],
[1, 3],
[2, 3]
])
})
it('should return 6x2 matrix solution for n = 4 and k = 2', () => {
const res = generateCombinations(4, 2)
expect(res).toEqual([
[1, 2],
[1, 3],
[1, 4],
[2, 3],
[2, 4],
[3, 4]
])
})
})