-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
test.js
59 lines (56 loc) · 2.09 KB
/
test.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const test = require("ava");
const e2c = require("./index.js");
// test functions
test("test electronToChromium", t => {
t.is(e2c.electronToChromium(1), "49");
t.is(e2c.electronToChromium(1.6), "56");
t.is(e2c.electronToChromium("1.6"), "56");
t.is(e2c.electronToChromium("1.5.1"), "54.0.2840.101");
t.is(e2c.electronToChromium("15.1.1"), "94.0.4606.61");
t.is(e2c.electronToChromium("9000"), undefined);
});
test("test chromiumToElectron", t => {
t.is(e2c.chromiumToElectron(1), undefined);
t.is(e2c.chromiumToElectron(56), "1.6");
t.is(e2c.chromiumToElectron("56"), "1.6");
t.deepEqual(e2c.chromiumToElectron("54.0.2840.51"), ["1.4.12"]);
t.is(e2c.chromiumToElectron("9000"), undefined);
});
test("test electronToBrowserList", t => {
t.is(e2c.electronToBrowserList("1.6"), "Chrome >= 56");
t.is(e2c.electronToBrowserList(9999), undefined);
});
// test lists
test("test versions", t => {
t.is(e2c.versions["1.6"], "56");
t.is(e2c.versions["15.0"], "94");
});
test("test fullVersions", t => {
t.is(e2c.fullVersions["1.5.1"], "54.0.2840.101");
t.is(e2c.fullVersions["15.1.1"], "94.0.4606.61");
});
test("test chromiumVersions", t => {
t.is(e2c.chromiumVersions["56"], "1.6");
t.is(e2c.chromiumVersions["94"], "15.0");
});
test("test fullChromiumVersions", t => {
t.deepEqual(e2c.fullChromiumVersions["54.0.2840.51"], ["1.4.12"]);
t.deepEqual(e2c.fullChromiumVersions["94.0.4606.61"], ["15.1.0", "15.1.1"]);
});
// test individial includes
test("test versions.js", t => {
t.is(require("./versions")["1.6"], "56");
t.is(require("./versions")["15.0"], "94");
});
test("test full-versions.js", t => {
t.is(require("./full-versions")["1.5.1"], "54.0.2840.101");
t.is(require("./full-versions")["15.1.1"], "94.0.4606.61");
});
test("test chromium-versions.js", t => {
t.is(require("./chromium-versions")["56"], "1.6");
t.is(require("./chromium-versions")["94"], "15.0");
});
test("test full-chromium-versions.js", t => {
t.deepEqual(require("./full-chromium-versions")["54.0.2840.51"], ["1.4.12"]);
t.deepEqual(require("./full-chromium-versions")["94.0.4606.61"], ["15.1.0", "15.1.1"]);
});