0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/versioning/pvp/util.spec.ts
Janus Troelsen 2f805f4b7d
feat(versioning): add PVP versioning scheme (#32298)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2024-12-06 10:21:07 +00:00

24 lines
632 B
TypeScript

import { extractAllParts, getParts } from './util';
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();
});
});
});