From 7dbc7651d61b12ba16d5ff1581398a3b0f3391d7 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Thu, 20 Apr 2017 16:57:52 -0700 Subject: [PATCH] make `axe` references clear --- lighthouse-core/gather/gatherers/accessibility.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lighthouse-core/gather/gatherers/accessibility.js b/lighthouse-core/gather/gatherers/accessibility.js index 7b18e9d7faf8..521358917c93 100644 --- a/lighthouse-core/gather/gatherers/accessibility.js +++ b/lighthouse-core/gather/gatherers/accessibility.js @@ -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: [ @@ -54,7 +54,7 @@ class Accessibility extends Gatherer { afterPass(options) { const driver = options.driver; const expression = `(function () { - ${axe}; + ${axeLibSource}; return (${runA11yChecks.toString()}()); })()`;