Importing and Initializing for Browser JavaScript

Link to Importing and Initializing for Browser JavaScript copied to clipboard

Importing and initializing the axe DevTools for Web Browser JavaScript package (@axe-devtools/browser)

Once you've installed axe DevTools for Web, you need to import it into your testing setup and initialize the package.

Prerequisites

In order to import and initialize axe DevTools for Web, it needs to be installed first. If you haven't yet, read the guide on how to install it from your artifact repository, or from Deque's Agora.

Importing and Initializing

To import the browser package, use a statement like this

import axeDevTools from '@axe-devtools/browser';

Once you've imported the browser package, you can initialize it with a statement like this:

axeDevTools.init();

Next Steps

Once you've installed, imported, and initialized axe DevTools, you're ready to move on to scanning for accessibility and writing accessibility tests. To do that, see the guide on writing tests.

Troubleshooting

If you have trouble with any of the importing or initializing of axe DevTools, contact your Deque representative directly, reach us via our support desk, or send us an email. We'll be happy to help.