mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
15 lines
479 B
JavaScript
15 lines
479 B
JavaScript
import { createPermutations } from '../CreatePermutations'
|
|
|
|
describe('createPermutations', () => {
|
|
it('expects to generate 6 different combinations', () => {
|
|
const text = 'abc'
|
|
const SUT = createPermutations(text)
|
|
expect(SUT).toStrictEqual(['abc', 'acb', 'bac', 'bca', 'cab', 'cba'])
|
|
})
|
|
it('expects to generate 2 different combinations', () => {
|
|
const text = '12'
|
|
const SUT = createPermutations(text)
|
|
expect(SUT).toStrictEqual(['12', '21'])
|
|
})
|
|
})
|