This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Kunka
committed
Dec 17, 2016
1 parent
4be4087
commit 83bf6d9
Showing
9 changed files
with
72 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use strict'; | ||
|
||
const chai = require('chai'); | ||
const mixitup = require('../../dist/mixitup.js'); | ||
|
||
const h = mixitup.h; | ||
|
||
describe('h#compareVersions()', () => { | ||
it('should return true if versions are matching', () => { | ||
let result = h.compareVersions('1.0.0', '1.0.0'); | ||
|
||
chai.assert.isOk(result); | ||
}); | ||
|
||
it('should return false if specimen version is less than control', () => { | ||
let result = h.compareVersions('1.0.0', '0.1.2'); | ||
|
||
chai.assert.isNotOk(result); | ||
}); | ||
|
||
it('should return true if specimen version is greater than control', () => { | ||
let result = h.compareVersions('1.0.0', '1.1.2'); | ||
|
||
chai.assert.isOk(result); | ||
}); | ||
|
||
it('should return true if specimen version is greater than control, with double figures', () => { | ||
let result = h.compareVersions('3.0.0', '10.1.2'); | ||
|
||
chai.assert.isOk(result); | ||
}); | ||
|
||
it('should handle semver carat notation', () => { | ||
let result = h.compareVersions('^3.0.0', '2.0.0'); | ||
|
||
chai.assert.isNotOk(result); | ||
}); | ||
|
||
it('should handle semver label notation', () => { | ||
let result = h.compareVersions('^3.0.0', '3.0.0-beta'); | ||
|
||
chai.assert.isOk(result); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters