forked from openupm/openupm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib-compare-versions.js
36 lines (34 loc) · 1.38 KB
/
lib-compare-versions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* eslint-disable no-undef */
const assert = require("assert");
const should = require("should");
const { compareVersions } = require("compare-versions");
describe("compareVersions", function() {
describe("compareVersions", function() {
it("should equal 1.0.0", function() {
compareVersions("1.0.0", "1.0.0").should.be.equal(0);
compareVersions("1.0.0-preview", "1.0.0-preview").should.be.equal(0);
compareVersions("1.0.0-preview.1", "1.0.0-preview.1").should.be.equal(0);
});
it("should equal 1.0.0-preview", function() {
compareVersions("1.0.0-preview", "1.0.0-preview").should.be.equal(0);
});
it("should equal 1.0.0-preview.1", function() {
compareVersions("1.0.0-preview.1", "1.0.0-preview.1").should.be.equal(0);
});
it("1.0.1 > 1.0.0", function() {
compareVersions("1.0.1", "1.0.0").should.be.equal(1);
});
it("1.0.0 > 1.0.0-preview", function() {
compareVersions("1.0.0", "1.0.0-preview").should.be.equal(1);
});
it("1.0.0 > 1.0.0-preview.1", function() {
compareVersions("1.0.0", "1.0.0-preview.1").should.be.equal(1);
});
it("1.0.1-preview.1 > 1.0.0", function() {
compareVersions("1.0.1-preview.1", "1.0.0").should.be.equal(1);
});
it("1.0.0-preview.2 > 1.0.0-preview.1", function() {
compareVersions("1.0.0-preview.2", "1.0.0-preview.1").should.be.equal(1);
});
});
});