feat(smartversion): add equality comparison methods for SmartVersion instances and version strings
This commit is contained in:
@@ -33,4 +33,14 @@ tap.test('should create a patch version', async () => {
|
||||
console.log(newVersion.versionString);
|
||||
})
|
||||
|
||||
tap.test('should compare versions for equality', async () => {
|
||||
const v1 = new smartversion.SmartVersion('1.2.3');
|
||||
const v2 = new smartversion.SmartVersion('1.2.3');
|
||||
const v3 = new smartversion.SmartVersion('1.2.4');
|
||||
expect(v1.equals(v2)).toBeTrue();
|
||||
expect(v1.equals(v3)).toBeFalse();
|
||||
expect(v1.equalsString('1.2.3')).toBeTrue();
|
||||
expect(v1.equalsString('1.2.4')).toBeFalse();
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
|
||||
Reference in New Issue
Block a user