Skip to content

Commit

Permalink
feat: add more to logs. skip document-title rule (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: a0k00e3 <[email protected]>
  • Loading branch information
ameyakoshti and a0k00e3 authored Jun 12, 2020
1 parent 27bf1b3 commit b8612cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ const createReport = violations => {
return green('0 violations found');
}

const report = violations.reduce((acc, { nodes, help }, i) => {
const report = violations.reduce((acc, { nodes, help, helpUrl, tags, impact, id }, i) => {
acc += red(`${i + 1}) ${help}\n`);
acc += red(`* ${helpUrl}\n`);
acc += red(`* ${tags.join(', ')}\n`);
acc += red(`* ${impact}\n`);
acc += red(`* ${id}\n`);

acc += reset(nodes.reduce((e, { target }) => {
const targetNodes = target.map((t) => `"${t}"`).join(', ');
Expand All @@ -31,8 +35,11 @@ const createReport = violations => {

};

const axeCheck = async (t, context, options) => {
const axeCheck = async (t, context, options={}) => {
try {
// skipping the "document-title" rule as there is an issue with testcafe
// being unable to find the title of a page inside the <head> tag.
options = options["rules"]['document-title'] = {'enabled': false};
return await runAxe.with({ boundTestRun: t })(context, options);
} catch (e) {
return { error: e };
Expand Down

0 comments on commit b8612cf

Please sign in to comment.