Skip to content

How to ignore certain rules for certain tests #638

@alexvuong

Description

@alexvuong

Hi,
I am wondering if we can turn off some certain rules for specific tests. For example, there are some accessibility errors happening due to the third-party usage. It is out of our control to fix those errors. We want to skip that check if it is possible

 expect(1 issues)toBeAccessible: expected document to have no accessibility violations but found 1 issues:

     "⭕ (aria-allowed-attr) Elements must only use allowed ARIA attributes: #popover-trigger-\\:rb\\:"
    	🔗 Help URL: https://dequeuniversity.com/rules/axe/4.7/aria-allowed-attr
    	🔗 WCAG Criteria: SA11Y-WCAG-SC4.1.2-P1(0 issues)

      130 |     })
      131 |     // To test using all rules provided by axe
    > 132 |     await expect(container).toBeAccessible(full)
          |                             ^
      133 | })
      134 |
      135 | /**

Something like jest-axe config? https://www.npmjs.com/package/jest-axe#setting-global-configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions