UNPKG

@axe-core/cli

Version:

A CLI for accessibility testing using axe-core

40 lines 2.44 kB
#!/usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const package_json_1 = require("../../package.json"); const utils_1 = require("../lib/utils"); const _1 = __importDefault(require(".")); const program = new commander_1.Command(); program .version(package_json_1.version) .usage('<url...> [options]') .option('-i, --include <list>', 'CSS selector of included elements, comma separated', utils_1.splitList) .option('-e, --exclude <list>', 'CSS selector of excluded elements, comma separated', utils_1.splitList) .option('-r, --rules <list>', 'IDs of rules to run, comma separated', utils_1.splitList) .option('-t, --tags <list>', 'Tags of rules to run, comma separated', utils_1.splitList) .option('-l, --disable <list>', 'IDs of rules to disable, comma separated', utils_1.splitList) .option('-b, --browser [browser-name]', 'Which browser to run (Webdriver required)') .option('-s, --save [filename]', 'Save the output as a JSON file. Filename is optional') .option('-j, --stdout', 'Output results to STDOUT and silence all other output') .option('-d, --dir <path>', 'Output directory') .option('-a, --axe-source <path>', 'Path to axe.js file') .option('-q, --exit', 'Exit with `1` failure code if any a11y tests fail') .option('-v, --verbose', 'Output metadata like test tool name, version and environment') .option('--load-delay <n>', 'Set how much time (milliseconds) axe will wait after page load before running the audit (default: 0)') .option('--timeout <n>', 'Set how much time (seconds) axe has to run', // @ts-ignore 90) .option('--timer', 'Log the time it takes to run') .option('--show-errors [boolean]', 'Display the full error stack', true) // TODO: Replace this with a reporter option, this required adding .option('--no-reporter', 'Turn the CLI reporter off') .option('--chrome-options [options]', 'Options to provide to headless Chrome', utils_1.splitList) .option('--chromedriver-path <path>', 'Absolute path to the desired chromedriver executable') .option('--chrome-path <path>', 'Path to the desired chrome executable') .action(_1.default); program.parse(process.argv); //# sourceMappingURL=cli.js.map