UNPKG

pa11y

Version:

Pa11y is your automated accessibility testing pal

29 lines (23 loc) 659 B
'use strict'; const bfj = require('bfj'); const report = module.exports = {}; // Pa11y version support report.supports = '^8.0.0 || ^8.0.0-alpha || ^8.0.0-beta'; // Output formatted results // NOTE: unlike other reporters, the JSON reporter uses streams and so outputs // results by itself rather than returning a string report.results = results => { const stream = bfj.streamify(results.issues); stream.on('dataError', error => { console.error(error.stack); process.exit(1); }); stream.on('end', () => { process.stdout.write('\n'); }); stream.pipe(process.stdout); }; // Output error messages report.error = message => { return message; };