You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **NOTE**: You can control how results are displayed via [the `violationsCallback` config option](#cyconfigureCypressAxe)
57
+
> **NOTE**: You can control how results are displayed via [the `violationsCb` config option](#cyconfigureCypressAxe)
58
58
59
59
After following the steps above (_and defining cy.tasks_), violations will be displayed as follows:
60
60
@@ -91,10 +91,10 @@ it('passes axe', () => {
91
91
// ...
92
92
93
93
cy.checkA11y() // checks the whole document
94
-
94
+
95
95
cy.get('#mobile-menu').checkA11y() // checks id="mobile-menu only
96
-
97
-
cy.wrap({ exclude: ['.not-me']}).checkA11y() // checks the whole document except class=".not-me"
96
+
97
+
cy.wrap({ exclude: ['.not-me']}).checkA11y() // checks the whole document except class=".not-me"
98
98
})
99
99
```
100
100
@@ -165,16 +165,16 @@ Instead of wrapping or overwriting `cy.checkA11y`, you can configure it. It acce
165
165
-`axeOptions` passed to axe-core.
166
166
-`shouldFailFn` function that returns array of violations to check for.
167
167
-`skipFailures` if true, it will log the violations but not assert against them.
168
-
-`violationsCallback` reporter function that receives the result.
168
+
-`violationsCb` reporter function that receives the result.
169
169
170
-
**The default**`violationsCallback` function assumes that `cy.task('log')` and `cy.task('table')` have been defined already during the [Installation & setup](#Installation-and-Setup). If you don't want to define those tasks, you can pass a function here to control how results are outputted.
170
+
**The default**`violationsCb` function assumes that `cy.task('log')` and `cy.task('table')` have been defined already during the [Installation & setup](#Installation-and-Setup). If you don't want to define those tasks, you can pass a function here to control how results are outputted.
171
171
172
172
```js
173
173
cy.configureCypressAxe({
174
174
axeOptions: [], // axe.RunOptions[]
175
175
shouldFailFn:violations=> violations,
176
176
skipFailures:false,
177
-
violationsCallback: ({
177
+
violationsCb: ({
178
178
filename:'test.spec.ts', // spec filename
179
179
results: [], // violations axe.Result[]
180
180
label:'my custom component', // if passed to checkA11y
0 commit comments