Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* istanbul ignore next */
try {
result = await context.evaluate(script);
} catch (e) {
let message: string;
if (e.message.includes('evaluation exceeded')) {
message = getMessage('notFastEnough', context.language);
} else {
message = getMessage('errorExecuting', context.language, e.message);
}
message = getMessage('tryAgainLater', context.language, message);
context.report(resource, message, { severity: Severity.warning });
debug('Error executing script %O', e);
return;
}
/* istanbul ignore next */
if (!result || !Array.isArray(result.violations)) {
debug(`Unable to parse axe results ${result}`);
return;
}
if (result.violations.length === 0) {
debug('No accessibility issues found');
return;