0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-05-14 16:32:26 +00:00
renovatebot_renovate/lib/modules/datasource/nuget/common.spec.ts
Michael Kriese 997c23502e
test: migrate to vitest (#34475)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-02-26 09:35:54 +00:00

27 lines
730 B
TypeScript

import { sortNugetVersions } from './common';
describe('modules/datasource/nuget/common', () => {
it.each`
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,
}: {
version: string;
other: string;
result: number;
}) => {
const res = sortNugetVersions(version, other);
expect(res).toBe(result);
},
);
});