| 123456789101112131415161718192021222324252627 |
- /// <reference types="../server/node_modules/@types/jest" />
- import { generateAllCombinations } from './shared-utils';
- describe('generateAllCombinations()', () => {
- it('works with an empty input array', () => {
- const result = generateAllCombinations([]);
- expect(result).toEqual([]);
- });
- it('works with an input of length 1', () => {
- const result = generateAllCombinations([['red', 'green', 'blue']]);
- expect(result).toEqual([['red'], ['green'], ['blue']]);
- });
- it('works with an input of length 2', () => {
- const result = generateAllCombinations([['red', 'green', 'blue'], ['small', 'large']]);
- expect(result).toEqual([
- ['red', 'small'],
- ['red', 'large'],
- ['green', 'small'],
- ['green', 'large'],
- ['blue', 'small'],
- ['blue', 'large'],
- ]);
- });
- });
|