Comply with ESM. Convert live code example to Jest test.

This commit is contained in:
Eric Lavault
2021-10-09 13:25:34 +02:00
parent cbe7e0c89f
commit 3f32320c85
2 changed files with 20 additions and 18 deletions

View 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)
})
})