Files
renovate/lib/modules/versioning/pvp/util.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

24 lines
635 B
TypeScript

import { extractAllParts, getParts } from './util.ts';
describe('modules/versioning/pvp/util', () => {
describe('.extractAllParts(version)', () => {
it('should return null when there are no numbers', () => {
expect(extractAllParts('')).toBeNull();
});
it('should parse 3.0', () => {
expect(extractAllParts('3.0')).toEqual([3, 0]);
});
});
describe('.getParts(...)', () => {
it('"0" is valid major version', () => {
expect(getParts('0')?.major).toEqual([0]);
});
it('returns null when no parts could be extracted', () => {
expect(getParts('')).toBeNull();
});
});
});