How to use the axe-core.configure function in axe-core

To help you get started, we’ve selected a few axe-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / addons / a11y / src / index.ts View on Github external
progress = progress.then(() => {
    axe.reset();
    if (config) {
      axe.configure(config);
    }
    return axe
      .run(
        element || getElement(),
        options ||
          ({
            restoreScroll: true,
          } as RunOptions) // cast to RunOptions is necessary because axe types are not up to date
      )
      .then(report)
      .catch(error => addons.getChannel().emit(EVENTS.ERROR, String(error)));
  });
};
github storybookjs / storybook / addons / a11y / src / components / WrapStory.js View on Github external
runA11yCheck() {
    const { channel, axeOptions } = this.props;
    const wrapper = findDOMNode(this);

    if (wrapper !== null) {
      axe.reset();
      axe.configure(axeOptions);
      axe.run(wrapper).then(results => channel.emit(CHECK_EVENT_ID, results), logger.error);
    }
  }
github intuit / proof / plugins / accessibility / src / main.ts View on Github external
(root, axeConfig, done) => {
                  axe.configure(axeConfig);
                  axe.run(root, (err, results) => {
                    if (err) done(err);
                    done(results);
                  });
                },
                root,
github dequelabs / react-axe / index.js View on Github external
var reactAxe = function reactAxe(_React, _ReactDOM, _timeout, conf) {
  React = _React;
  ReactDOM = _ReactDOM;
  timeout = _timeout;

  if (conf) {
    axeCore.configure(conf);
  }
  axeCore.configure({
    checks: [
      {
        id: 'color-contrast',
        options: {
          noScroll: true
        }
      }
    ]
  });

  if (!_createElement) {
    _createElement = React.createElement;

    React.createElement = function() {
      var reactEl = _createElement.apply(this, arguments);
github dequelabs / react-axe / index.js View on Github external
var reactAxe = function reactAxe(_React, _ReactDOM, _timeout, conf) {
  React = _React;
  ReactDOM = _ReactDOM;
  timeout = _timeout;

  if (conf) {
    axeCore.configure(conf);
  }
  axeCore.configure({
    checks: [
      {
        id: 'color-contrast',
        options: {
          noScroll: true
        }
      }
    ]
  });

  if (!_createElement) {
    _createElement = React.createElement;

    React.createElement = function() {

axe-core

Accessibility engine for automated Web UI testing

MPL-2.0
Latest version published 29 days ago

Package Health Score

100 / 100
Full package analysis