Skip to content

Conversation

mwmcode
Copy link

@mwmcode mwmcode commented Apr 24, 2021

Trying to implement #75 (to the best of my knowledge/understanding).

I made shouldFail return array of violations instead of boolean.

shouldFail?: (violations: axe.Result[]) => axe.Result[];

Users can filter out the violations that they want to skip and only return the ones they want to assert against.

For example, I'm wrapping checkA11y to filter out color-contrast violations

Cypress.Commands.add(
  'customCheckA11y',
  { prevSubject: 'optional' },
  (subject, options, label) => {
    return cy.checkA11y({
      shouldFail: violations => violations.filter(v => v.id !== 'color-contrast')
    });
  }
);

Also

  • updated dependencies
  • upgraded cypress dependency to include v7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant