Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)));
});
};
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);
}
}
(root, axeConfig, done) => {
axe.configure(axeConfig);
axe.run(root, (err, results) => {
if (err) done(err);
done(results);
});
},
root,
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);
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() {