-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.mjs
More file actions
7 lines (7 loc) · 867 Bytes
/
Copy pathtest.mjs
File metadata and controls
7 lines (7 loc) · 867 Bytes
1
2
3
4
5
6
7
import { readFileSync } from 'node:fs';
const html=readFileSync(new URL('./index.html',import.meta.url),'utf8');
for(const token of ['Website Accessibility Acceptance Evidence Builder','Turn an accessibility finding into evidence a team can repeat.','id="journey"','id="outcome"','id="method"','role="status"','W3C evaluating web accessibility','WordPress accessibility standards','evolveddesigns.net/website-accessibility-readiness/'])if(!html.includes(token))throw new Error(`Missing ${token}`);
if((html.match(/<h1>/g)||[]).length!==1)throw new Error('Expected one H1');
if((html.match(/rel="canonical"/g)||[]).length!==1)throw new Error('Expected one canonical');
if(/microsoft clarity|clarity\(|gtag\(|google-analytics|<form/i.test(html))throw new Error('Unexpected tracking or submission token');
console.log('Accessibility acceptance builder checks passed.');