mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
Comply with ESM. Convert live code example to Jest test.
This commit is contained in:
19
Maths/test/PermutationAndCombination.test.js
Normal file
19
Maths/test/PermutationAndCombination.test.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { factorial, permutation, combination } from '../PermutationAndCombination'
|
||||
|
||||
describe('Factorial', () => {
|
||||
it('factorial(5)', () => {
|
||||
expect(factorial(5)).toBe(120)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Permutation', () => {
|
||||
it('permutation(5, 2)', () => {
|
||||
expect(permutation(5, 2)).toBe(20)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Combination', () => {
|
||||
it('combination(5, 2)', () => {
|
||||
expect(combination(5, 2)).toBe(10)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user