Repository URL to install this package:
|
Version:
0.0.9 ▾
|
const path = require('path');
const defaultConfig = {
/**
* Where the reports will be saved.
*/
reportsPath: 'dist/a11y-reports',
/**
* Whether to show more descriptive logs.
*/
verbose: false,
/**
* The base configuration options for Pa11y.
* Uncomment or add more as needed.
*
* Pa11y configuration:
* {@see https://github.com/pa11y/pa11y#configuration}
*
* Puppeteer configuration (chromeLaunchConfig):
* {@see https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions}
*/
pa11y: {
ignore: [
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail',
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G145.Fail',
'WCAG2AA.Principle2.Guideline2_4.2_4_1.H64.1'
],
/** Change the Pa11y timeout if needed */
// timeout: 60000,
/** Additionally include A11Y notices and warnings in the reports */
includeNotices: true,
includeWarnings: true,
/** See https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions */
chromeLaunchConfig: {
/** Use this if you want to see what's going on */
// headless: false,
/** Open the devtools when Chromium is started? */
// devtools: true,
}
}
};
const packageJson = require(path.resolve(process.cwd(), 'package.json'));
const config = Object.assign({}, defaultConfig, packageJson.a11ytester);
if (config.verbose) {
// Needs to be added like this, because we cannot provide console methods in the json configuration.
config.pa11y = Object.assign({}, config.pa11y, {
log: {
debug: console.log,
error: console.error,
info: console.info
}
})
}
module.exports = {
get: () => config
};