add test case for semver major comparisons

This commit is contained in:
chenpeng
2023-02-20 22:36:48 +08:00
committed by GitHub
parent 6b6d0617ef
commit 8a82207286

View File

@@ -260,12 +260,14 @@ describe('utils', () => {
expect(gte('1.2.3', '1.2.1')).toBe(true);
expect(gte('1.2.1', '1.2.1')).toBe(true);
expect(gte('1.2.1', '1.2.2')).toBe(false);
expect(gte('10.0.0', '9.0.0')).toBe(true);
});
it('gt should compare versions correctly', () => {
expect(gt('1.2.3', '1.2.1')).toBe(true);
expect(gt('1.2.1', '1.2.1')).toBe(false);
expect(gt('1.2.1', '1.2.2')).toBe(false);
expect(gte('10.0.0', '9.0.0')).toBe(true);
});
});
});