UNPKG

nightwatch-axe-verbose

Version:

For adding custom commands to allow you to run axe accessibility tests in your NightwatchJS test cases.

17 lines (14 loc) 337 B
const fs = require('fs'); const axePath = require.resolve('axe-core/axe.min.js'); const axe = fs.readFileSync(axePath, 'utf8'); module.exports = class AxeInject { command() { return this.api.execute( (js) => { // eslint-disable-next-line no-eval eval(js); }, [axe] ); } };