Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Enable program to work with pkg #48

Merged
merged 6 commits into from
Jul 14, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/cli/lib/axe-test-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ function testPages(urls, config, events) {
driver
.get(currentUrl)
.then(function () {
// Wait for the page to be loaded
return driver.executeAsyncScript(function (callback) {
// https://github.com/vercel/pkg/issues/676
// we need to pass a string vs a function so we manually stringified the function
return driver.executeAsyncScript(`
const callback = arguments[arguments.length - 1];
const script = document.createElement('script');
script.innerHTML =
'document.documentElement.classList.add("deque-axe-is-ready");';
script.innerHTML = 'document.documentElement.classList.add("deque-axe-is-ready");'
document.documentElement.appendChild(script);
callback();
});
`);
})
.then(function () {
return driver.wait(
Expand Down