0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/modules/datasource/nuget/common.spec.ts

20 lines
684 B
TypeScript

import { sortNugetVersions } from './common';
describe('modules/datasource/nuget/common', () => {
it.each<{ version: string; other: string; result: number }>`
version | other | result
${'invalid1'} | ${'invalid2'} | ${0}
${'invalid'} | ${'1.0.0'} | ${-1}
${'1.0.0'} | ${'invalid'} | ${1}
${'1.0.0-rc.1'} | ${'1.0.0'} | ${-1}
${'1.0.0'} | ${'1.0.0-rc.1'} | ${1}
${'1.0.0'} | ${'1.0.0'} | ${0}
`(
'sortNugetVersions("$version", "$other") === $result',
({ version, other, result }) => {
const res = sortNugetVersions(version, other);
expect(res).toBe(result);
},
);
});