Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rfc 75 #94

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

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