-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpa11y_runner.js
More file actions
30 lines (25 loc) · 828 Bytes
/
pa11y_runner.js
File metadata and controls
30 lines (25 loc) · 828 Bytes
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
const pa11y = require('pa11y');
const fs = require('fs');
(async () => {
const url = "https://katalysttech.com/";
const results = await pa11y(url, {
standard: 'WCAG2AAA',
includeWarnings: true,
includeNotices: true,
chromeLaunchConfig: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
});
// Save full raw JSON output
fs.writeFileSync('pa11y_output.json', JSON.stringify(results, null, 2));
console.log('✅ Pa11y results saved to pa11y_output.json');
// Optionally also log to console (processed form)
const simplified = results.issues.map(issue => ({
code: issue.code,
message: issue.message,
selector: issue.selector,
context: issue.context,
type: issue.type
}));
console.log(JSON.stringify(simplified, null, 2));
})();