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: proper imports in esm context #718

Merged
merged 7 commits into from
May 2, 2023
Merged

fix: proper imports in esm context #718

merged 7 commits into from
May 2, 2023

Conversation

AdnoC
Copy link
Contributor

@AdnoC AdnoC commented May 1, 2023

Closes: #717

@AdnoC AdnoC requested a review from a team as a code owner May 1, 2023 17:14
@AdnoC AdnoC marked this pull request as draft May 1, 2023 18:11
@AdnoC AdnoC marked this pull request as ready for review May 1, 2023 19:07
Zidious
Zidious previously requested changes May 2, 2023
Copy link
Contributor

@Zidious Zidious left a comment

Choose a reason for hiding this comment

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

Minor things inline, also desc of PR should use "Closes: XXX" so it can go into the QA column

Comment on lines 57 to 68
let axeCorePath = '';
if (typeof require === 'function' && typeof require.resolve === 'function') {
axeCorePath = require.resolve('axe-core');
} else {
const { createRequire } = (await import('node:module')) as any;
const filename = pathToFileURL(getFilename()).toString();

const require = createRequire(filename);
axeCorePath = require.resolve('axe-core');
}

const source = fs.readFileSync(axeCorePath, 'utf8');
Copy link
Contributor

Choose a reason for hiding this comment

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

We should comment on why this was necessary to add vs just using __filename

packages/webdriverio/src/index.ts Show resolved Hide resolved
@AdnoC AdnoC dismissed Zidious’s stale review May 2, 2023 13:33

added comment

Zidious
Zidious previously requested changes May 2, 2023
Copy link
Contributor

@Zidious Zidious left a comment

Choose a reason for hiding this comment

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

Sorry - forgot to add, we should add a test

Zidious
Zidious previously approved these changes May 2, 2023
@AdnoC AdnoC merged commit f2a41bc into develop May 2, 2023
@AdnoC AdnoC deleted the fix-qa-import branch May 2, 2023 14:38
This was referenced May 2, 2023
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.

BUG: ESM support is throwing error for Puppeteer and webdriverio
2 participants