-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck-pwa-audits.js
More file actions
42 lines (36 loc) · 1.22 KB
/
Copy pathcheck-pwa-audits.js
File metadata and controls
42 lines (36 loc) · 1.22 KB
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
const r = require('./lighthouse-full-report.json');
console.log('═══════════════════════════════════════');
console.log(' PWA INSTALLABILITY CHECK');
console.log('═══════════════════════════════════════');
console.log('');
const pwaAudits = [
'installable-manifest',
'service-worker',
'splash-screen',
'themed-omnibox',
'viewport',
'apple-touch-icon',
'maskable-icon',
'content-width'
];
let passing = 0;
let failing = 0;
pwaAudits.forEach(id => {
const a = r.audits[id];
if (a) {
const s = a.score === null ? '⚪' : a.score === 1 ? '✅' : '❌';
console.log(`${s} ${a.title}`);
if (a.score !== null && a.score < 1 && a.description) {
console.log(` Issue: ${a.description.substring(0, 100)}`);
failing++;
} else if (a.score === 1) {
passing++;
}
}
});
console.log('');
console.log('Summary:');
console.log(` Passing: ${passing}`);
console.log(` Failing: ${failing}`);
console.log('');
console.log('═══════════════════════════════════════');