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(webdriverjs): Enable library to work in pkged programs #49

Merged
merged 3 commits into from
Jul 13, 2020

Conversation

michael-siek
Copy link
Member

@michael-siek michael-siek commented Jul 9, 2020

See: https://github.com/dequelabs/axe-devtools-npm/issues/715

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Code is reviewed for security

@michael-siek michael-siek requested review from a team and stephenmathieson July 9, 2020 23:28
@stephenmathieson stephenmathieson changed the title fix(webdriverjs): pass in string into executeAsyncScript instead of function fix(webdriverjs): Enable library to work in pkged programs Jul 10, 2020
@@ -96,25 +96,28 @@ class AxeInjector {
return new Promise((resolve, reject) => {
/* eslint-disable no-undef */
this.driver
.executeAsyncScript(function (callback) {
const iframes = Array.from(
.executeAsyncScript(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining why this is necessary and link to vercel/pkg#676

context,
options,
config
`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Add a comment please.

assert.equal(config, catsConfig);
executeAsyncScript: function (callback) {
// Since we are stringifying executeAsyncScript we need to see if config gets passed into executeAsyncScript
const [cats] = callback.match(/\s*("options":\s*\["cats"])/g);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cats?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're not adding this. We have a strange obsession with cats in a lot of our older codebases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change it to bears? 🐻

@michael-siek michael-siek merged commit e073487 into develop Jul 13, 2020
@michael-siek michael-siek deleted the fix-webdriver-async-script branch July 13, 2020 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants