-
Notifications
You must be signed in to change notification settings - Fork 7
FAQ & Troubleshooting
Andrew Holloway edited this page Jan 23, 2025
·
1 revision
Here we document some commonly seen issues, with details on the cause(s) and ways to resolve. For any new issues, feel free to file an issue and we can discuss and include as needed.
- You may encounter many / all tests suddenly failing in CI or when running a configured script which runs
axe-storybook
- The error may also suggest running tests by using
await axe.run()
- This may have occurred after a recent upgrade to other project packages (e.g., storybook addons, or other plugins that alter stories)
Problem: a storybook addon has imported axe-core
which conflicts with the version provided by axe-storybook-testing
- Importing multiple copies of
axe-core
can putwindow.axe
in an unstable state - axe-storybook-testing uses
axe-core
to run, so having any other addon import the package will break the test run -
As of v8.5.0,
@storybook/addon-a11y
usesaxe-core
in a way that conflicts withaxe-storybook-testing
Related Issue(s): #103
With storybook, it is possible to build stories using different configuration during test. Configure axe-storybook
to run after building the stories without the conflicting addon(s).
- Use
storybook build --test
in your npm script
// In package.json
"scripts": {
"test:axe": "storybook build --test && axe-storybook"
},
- In your storybook config file (likely either main.js or main.js), add in test config to disable the conflicting package.
// in your main.(js|ts) file config
build: {
test: {
disabledAddons: ['@storybook/addon-a11y'],
},
},