Skip to content

Commit

Permalink
Merge pull request #14 from justafish/justafish/fix-axe-path-resolution
Browse files Browse the repository at this point in the history
Fix path resolution for axe.min.js
  • Loading branch information
reallymello committed Jul 5, 2023
2 parents b964382 + fe245f2 commit 6e38cad
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions nightwatch/commands/axeInject.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
const fs = require('fs');
const path = require('path');

const localPath = path.join(
__dirname,
'..',
'..',
'node_modules',
'axe-core',
'axe.min.js'
);
const parentPath = path.join(
__dirname,
'..',
'..',
'..',
'axe-core',
'axe.min.js'
);

const axe = fs.existsSync(localPath)
? fs.readFileSync(localPath, 'utf8')
: fs.readFileSync(parentPath, 'utf8');
const axePath = require.resolve('axe-core/axe.min.js');
const axe = fs.readFileSync(axePath, 'utf8');

module.exports = class AxeInject {
command() {
Expand Down

0 comments on commit 6e38cad

Please sign in to comment.