mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
chore: Merge pull request #768 from lvlte/issues/720
Changes for consolidation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { binaryExponentiation } = require('../BinaryExponentiationRecursive')
|
||||
import { binaryExponentiation } from '../BinaryExponentiationRecursive'
|
||||
|
||||
describe('BinaryExponentiationRecursive', () => {
|
||||
it('should calculate 2 to the power of 10 correctly', () => {
|
||||
|
||||
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