-
Notifications
You must be signed in to change notification settings - Fork 3
/
integration.ts
88 lines (86 loc) · 5.92 KB
/
integration.ts
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const plugin = require("./dist");
import posthtml from "posthtml";
import fs from "fs";
const iconPath = "./__tests__/icon.png";
const html = `
<!doctype html>
<html>
<head>
<link rel="icon" href="${iconPath}" />
</head>
<body>
</body>
</html>`;
console.time("processing time");
posthtml()
.use(plugin({ outDir: "./__tests__/dist", configuration: { path: "/icons" } }))
.process(html)
.then((res: any) => {
console.log(res.html);
console.timeEnd("processing time");
console.assert(fs.existsSync("./__tests__/dist/android-chrome-144x144.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-192x192.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-256x256.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-36x36.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-384x384.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-48x48.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-512x512.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-72x72.png"));
console.assert(fs.existsSync("./__tests__/dist/android-chrome-96x96.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-1024x1024.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-114x114.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-120x120.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-144x144.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-152x152.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-167x167.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-180x180.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-57x57.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-60x60.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-72x72.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-76x76.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon-precomposed.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-icon.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1125x2436.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1136x640.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1242x2208.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1242x2688.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1334x750.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1536x2048.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1620x2160.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1668x2224.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1668x2388.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-1792x828.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2048x1536.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2048x2732.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2160x1620.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2208x1242.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2224x1668.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2388x1668.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2436x1125.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2688x1242.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-2732x2048.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-640x1136.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-750x1334.png"));
console.assert(fs.existsSync("./__tests__/dist/apple-touch-startup-image-828x1792.png"));
console.assert(fs.existsSync("./__tests__/dist/browserconfig.xml"));
console.assert(fs.existsSync("./__tests__/dist/coast-228x228.png"));
console.assert(fs.existsSync("./__tests__/dist/favicon-16x16.png"));
console.assert(fs.existsSync("./__tests__/dist/favicon-32x32.png"));
console.assert(fs.existsSync("./__tests__/dist/favicon-48x48.png"));
console.assert(fs.existsSync("./__tests__/dist/favicon.ico"));
console.assert(fs.existsSync("./__tests__/dist/firefox_app_128x128.png"));
console.assert(fs.existsSync("./__tests__/dist/firefox_app_512x512.png"));
console.assert(fs.existsSync("./__tests__/dist/firefox_app_60x60.png"));
console.assert(fs.existsSync("./__tests__/dist/manifest.json"));
console.assert(fs.existsSync("./__tests__/dist/manifest.webapp"));
console.assert(fs.existsSync("./__tests__/dist/mstile-144x144.png"));
console.assert(fs.existsSync("./__tests__/dist/mstile-150x150.png"));
console.assert(fs.existsSync("./__tests__/dist/mstile-310x150.png"));
console.assert(fs.existsSync("./__tests__/dist/mstile-310x310.png"));
console.assert(fs.existsSync("./__tests__/dist/mstile-70x70.png"));
console.assert(fs.existsSync("./__tests__/dist/yandex-browser-50x50.png"));
console.assert(fs.existsSync("./__tests__/dist/yandex-browser-manifest.json"));
})
.catch((err: Error) => {
throw err;
});