update to support compare functions

This commit is contained in:
2017-08-18 10:58:00 +02:00
parent ea6fc17f21
commit 79b0448444
4 changed files with 33 additions and 1 deletions

View File

@ -7,4 +7,16 @@ tap.test('should create a valid SmartVersion', async () => {
expect(localSmartVersion).to.be.instanceof(smartversion.SmartVersion)
})
tap.test('should correctly classify greater and less than', async () => {
// tslint:disable-next-line:no-unused-expression
expect(localSmartVersion.greaterThanString('4.0.0')).to.be.false
// tslint:disable-next-line:no-unused-expression
expect(localSmartVersion.greaterThanString('3.0.0')).to.be.true
// tslint:disable-next-line:no-unused-expression
expect(localSmartVersion.lessThanString('v4.0.0')).to.be.true
// tslint:disable-next-line:no-unused-expression
expect(localSmartVersion.lessThanString('v3.0.0')).to.be.false
})
tap.start()