mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
12 lines
380 B
TypeScript
12 lines
380 B
TypeScript
import { coerceNumber } from './number';
|
|
|
|
describe('util/number', () => {
|
|
it.each`
|
|
val | def | expected
|
|
${1} | ${2} | ${1}
|
|
${undefined} | ${2} | ${2}
|
|
${undefined} | ${undefined} | ${0}
|
|
`('coerceNumber($val, $def) = $expected', ({ val, def, expected }) => {
|
|
expect(coerceNumber(val, def)).toBe(expected);
|
|
});
|
|
});
|