Files
renovate/lib/modules/datasource/nuget/common.spec.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

28 lines
733 B
TypeScript

import { sortNugetVersions } from './common.ts';
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);
},
);
});