Skip to content

Commit

Permalink
make axe references clear
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Apr 20, 2017
1 parent e0f584d commit 7dbc765
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lighthouse-core/gather/gatherers/accessibility.js
Expand Up @@ -16,18 +16,18 @@
*/
'use strict';

/* global document */
/* global window, document */

const Gatherer = require('./gatherer');
const fs = require('fs');
const axe = fs.readFileSync(require.resolve('axe-core/axe.min.js'), 'utf8');
const axeLibSource = fs.readFileSync(require.resolve('axe-core/axe.min.js'), 'utf8');

// This is run in the page, not Lighthouse itself.
// axe.run returns a promise which fulfills with a results object
// containing any violations.
/* istanbul ignore next */
function runA11yChecks() {
return axe.run(document, {
return window.axe.run(document, {
runOnly: {
type: 'tag',
values: [
Expand All @@ -54,7 +54,7 @@ class Accessibility extends Gatherer {
afterPass(options) {
const driver = options.driver;
const expression = `(function () {
${axe};
${axeLibSource};
return (${runA11yChecks.toString()}());
})()`;

Expand Down

0 comments on commit 7dbc765

Please sign in to comment.