0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-11 05:39:10 +00:00
renovatebot_renovate/lib/util/array.spec.ts
2023-09-06 11:26:22 +00:00

21 lines
537 B
TypeScript

import { isNotNullOrUndefined, toArray } from './array';
describe('util/array', () => {
it.each`
a | exp
${null} | ${false}
${undefined} | ${false}
${{ name: 'foo' }} | ${true}
`('.isNotNullOrUndefined', ({ a, exp }) => {
expect(isNotNullOrUndefined(a)).toEqual(exp);
});
it.each`
a | exp
${null} | ${[null]}
${undefined} | ${[undefined]}
${[]} | ${[]}
`('.toArray', ({ a, exp }) => {
expect(toArray(a)).toEqual(exp);
});
});