forked from electron/update.electronjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasset-platform.test.js
70 lines (66 loc) · 1.94 KB
/
asset-platform.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
60
61
62
63
64
65
66
67
68
69
70
const { test } = require("tap");
const { assetPlatform } = require("../src/asset-platform");
const { PLATFORM_ARCH } = require("../src/constants");
test("assetPlatform() matches the right platform", (t) => {
const releases = [
{ name: "electron-fiddle-0.27.3-1.arm64.rpm", platform: false },
{ name: "electron-fiddle-0.27.3-1.armv7hl.rpm", platform: false },
{ name: "electron-fiddle-0.27.3-1.x86_64.rpm", platform: false },
{ name: "electron-fiddle-0.27.3-full.nupkg", platform: false },
{
name: "electron-fiddle-0.27.3-win32-arm64-setup.exe",
platform: PLATFORM_ARCH.WIN_ARM64,
},
{
name: "electron-fiddle-0.27.3-win32-ia32-setup.exe",
platform: PLATFORM_ARCH.WIN_IA32,
},
{
name: "electron-fiddle-0.27.3-win32-x64-setup.exe",
platform: PLATFORM_ARCH.WIN_X64,
},
{ name: "electron-fiddle_0.27.3_amd64.deb", platform: false },
{ name: "electron-fiddle_0.27.3_arm64.deb", platform: false },
{ name: "electron-fiddle_0.27.3_armhf.deb", platform: false },
{
name: "Electron.Fiddle-darwin-arm64-0.27.3.zip",
platform: PLATFORM_ARCH.DARWIN_ARM64,
},
{
name: "Electron.Fiddle-darwin-x64-0.27.3.zip",
platform: PLATFORM_ARCH.DARWIN_X64,
},
{
name: "Electron-Builder-1.2.3-mac.zip",
platform: PLATFORM_ARCH.DARWIN_X64,
},
{
name: "Electron-Builder-1.2.3-universal-mac.zip",
platform: PLATFORM_ARCH.DARWIN_UNIVERSAL,
},
{
name: "Electron-Builder-1.2.3-arm64-mac.zip",
platform: PLATFORM_ARCH.DARWIN_ARM64,
},
{
name: "Electron.Builder-1.2.3-mac.zip.blockmap",
platform: false,
},
{
name: "mac.zip",
platform: false,
},
{
name: "darwin.zip",
platform: false,
},
{
name: "osx.zip",
platform: false,
},
];
for (const release of releases) {
t.equal(assetPlatform(release.name), release.platform);
}
t.end();
});