Lazy load axe-core only when running tests

This commit is contained in:
Benjamin Kindle 2021-10-26 20:19:11 -04:00
parent b4afd45ecf
commit b5bddca8e4

View File

@ -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';
@ -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();