Skip to content

Commit

Permalink
Merge pull request #17 from garg3133/fix-context
Browse files Browse the repository at this point in the history
Allow non-string values as context.
  • Loading branch information
reallymello committed Jan 16, 2024
2 parents 32cd547 + bc6ffc3 commit d19e5a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions nightwatch/commands/axeInjectFunc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/* eslint-disable */
module.exports = function (selector, options, done) {
module.exports = function(selector, options, done) {
var axe = window.axe;
if (!axe) {
done(new Error('aXe not found. Make sure it has been injected'))
return;
}

const el = document.querySelector(selector);

axe.run(el, options, function (err, results) {
axe.run(selector, options, function(err, results) {
if (err) {
done(err);
}

done(results);
});
};

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightwatch-axe-verbose",
"version": "2.2.3",
"version": "2.3.0",
"description": "For adding custom commands to allow you to run axe accessibility tests in your NightwatchJS test cases.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d19e5a1

Please sign in to comment.