-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathlighthouserc.cjs
More file actions
46 lines (42 loc) · 1.27 KB
/
lighthouserc.cjs
File metadata and controls
46 lines (42 loc) · 1.27 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
43
44
45
46
const PATHS = [
"/",
"/mentions-legales",
"/plan-du-site",
"/accessibilite",
"/droit-du-travail",
"/outils",
"/fiche-service-public/arret-maladie-indemnites-journalieres-versees-au-salarie",
"/information/licenciement-pour-inaptitude-medicale",
"/stats",
"/themes/contrat-de-travail",
"/recherche?query=cong%C3%A9s%20sans%20solde",
"/modeles-de-courriers/rupture-du-contrat-en-periode-dessai-a-linitiative-du-salarie",
"/contribution/les-conges-pour-evenements-familiaux",
"/glossaire",
"/fiche-ministere-travail/les-jours-feries-et-les-ponts",
"/code-du-travail/d3133-1",
"/convention-collective/2120-banque",
"/outils/indemnite-licenciement",
"/outils/indemnite-rupture-conventionnelle",
];
function normalizeBaseUrl(raw) {
const trimmed = String(raw ?? "").trim();
return trimmed.endsWith("/") ? trimmed.slice(0, -1) : trimmed;
}
if (!process.env.LHCI_BASE_URL) {
throw new Error("LHCI_BASE_URL environment variable is not set");
}
const baseUrl = normalizeBaseUrl(process.env.LHCI_BASE_URL);
const urls = PATHS.map((path) => new URL(path, baseUrl).toString());
module.exports = {
ci: {
collect: {
url: urls,
},
assert: {
assertions: {
"categories:accessibility": ["error", { minScore: 1 }],
},
},
},
};