2018-09-02 10:26:04 +00:00
|
|
|
import { expect, tap } from '@pushrocks/tapbundle';
|
|
|
|
import * as smartversion from '../ts/index';
|
2017-08-17 14:15:47 +00:00
|
|
|
|
2018-09-02 10:26:04 +00:00
|
|
|
let localSmartVersion: smartversion.SmartVersion;
|
2017-08-17 14:15:47 +00:00
|
|
|
tap.test('should create a valid SmartVersion', async () => {
|
2018-09-02 10:26:04 +00:00
|
|
|
localSmartVersion = new smartversion.SmartVersion('3.2.1');
|
|
|
|
expect(localSmartVersion).to.be.instanceof(smartversion.SmartVersion);
|
|
|
|
});
|
2017-08-17 14:15:47 +00:00
|
|
|
|
2017-08-18 08:58:00 +00:00
|
|
|
tap.test('should correctly classify greater and less than', async () => {
|
|
|
|
// tslint:disable-next-line:no-unused-expression
|
2018-09-02 10:26:04 +00:00
|
|
|
expect(localSmartVersion.greaterThanString('4.0.0')).to.be.false;
|
2017-08-18 08:58:00 +00:00
|
|
|
// tslint:disable-next-line:no-unused-expression
|
2018-09-02 10:26:04 +00:00
|
|
|
expect(localSmartVersion.greaterThanString('3.0.0')).to.be.true;
|
2017-08-18 08:58:00 +00:00
|
|
|
// tslint:disable-next-line:no-unused-expression
|
2018-09-02 10:26:04 +00:00
|
|
|
expect(localSmartVersion.lessThanString('v4.0.0')).to.be.true;
|
2017-08-18 08:58:00 +00:00
|
|
|
// tslint:disable-next-line:no-unused-expression
|
2018-09-02 10:26:04 +00:00
|
|
|
expect(localSmartVersion.lessThanString('v3.0.0')).to.be.false;
|
|
|
|
});
|
2017-08-18 08:58:00 +00:00
|
|
|
|
2018-09-02 10:26:04 +00:00
|
|
|
tap.start();
|