Skip to content

Commit 1a11476

Browse files
authored
Merge branch 'master' into feat/add-custom-result-handler
2 parents 53cd4d2 + f34773b commit 1a11476

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ if (process.env.NODE_ENV !== 'production') {
3838
|`clearConsoleOnUpdate`|Clears the console each time `vue-axe` runs|`true`|`false`|
3939
|`customResultHandler`|Handle the results from an `axe.run()`. This may be needed for automated tests.|`undefined`|`false`|
4040
|`config`|Provide your Axe-core configuration: https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure| |`false`|
41+
|`runOptions`|Provide your Axe-core runtime options: [API Name: axe.run](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter)|`{ reporter: 'v2', resultTypes: ['violations'] }`|`false`|
4142

4243
#### Custom Result Handler
4344

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export default function install (Vue, options) {
99

1010
options = {
1111
clearConsoleOnUpdate: true,
12+
runOptions: {
13+
reporter: 'v2',
14+
resultTypes: ['violations']
15+
},
1216
...options
1317
}
1418

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function checkAndReport (options, node) {
1313
nodes.push(node)
1414
let deferred = createDeferred()
1515

16-
axeCore.run(document, { reporter: 'v2' }, (error, results) => {
16+
axeCore.run(document, options.runOptions, (error, results) => {
1717
if (error) deferred.reject(error)
1818
if (!results) return
1919
if (JSON.stringify(results.violations) === lastNotification) return

0 commit comments

Comments
 (0)