react-day-picker
Version:
Customizable Date Picker for React
23 lines (18 loc) • 671 B
text/typescript
import { matcherToArray } from 'contexts/Modifiers/utils/matcherToArray';
import { Matcher } from 'types/Matchers';
const matcher: Matcher = jest.fn();
describe('when a Matcher is passed in', () => {
test('should return an array with the Matcher', () => {
expect(matcherToArray(matcher)).toStrictEqual([matcher]);
});
});
describe('when an array of Matchers is passed in', () => {
test('should return the array', () => {
expect(matcherToArray([matcher])).toStrictEqual([matcher]);
});
});
describe('when undefined is passed in', () => {
test('should return an empty array', () => {
expect(matcherToArray(undefined)).toStrictEqual([]);
});
});