Skip to content

Commit

Permalink
Merge pull request storybookjs#16484 from literalpie/lazy-a11y
Browse files Browse the repository at this point in the history
Addon-a11y: Lazy load axe-core only when running tests
  • Loading branch information
shilman committed Oct 28, 2021
2 parents 63e26bb + 30d9508 commit 0787164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/a11y/src/a11yRunner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import global from 'global';
import axe from 'axe-core';
import { addons } from '@storybook/addons';
import { EVENTS } from './constants';
import { A11yParameters } from './params';
Expand Down Expand Up @@ -40,6 +39,7 @@ const run = async (storyId: string) => {
if (!active) {
active = true;
channel.emit(EVENTS.RUNNING);
const axe = await import('axe-core');

const { element = getElement(), config, options = {} } = input;
axe.reset();
Expand Down

0 comments on commit 0787164

Please sign in to comment.