Skip to content

Commit

Permalink
docs(readme): use axe.run() promise API (#2072)
Browse files Browse the repository at this point in the history
* docs(readme): use axe.run() promise API

* Update README.md
  • Loading branch information
WilcoFiers authored and straker committed Mar 6, 2020
1 parent 91fc9bb commit 60a6cb1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ Now include the javascript file in each of your iframes in your fixtures or test
Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:

```js
axe.run(function (err, results) {
if (err) throw err;
ok(results.violations.length === 0, 'Should be no accessibility issues');
// complete the async call
...
});
axe.run()
.then(results => {
if (results.violations.length) {
throw new Error('Accessibility issues found')
}
})
.catch(err => {
console.error('Something bad happened:', err.message)
})
```

## Supported Browsers
Expand Down

0 comments on commit 60a6cb1

Please sign in to comment.