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

chore: remove manual __esModule override #28935

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

pavelfeldman
Copy link
Member

No description provided.

This comment has been minimized.

@jdalton
Copy link

jdalton commented Jan 10, 2024

Related to #28875.

@jdalton
Copy link

jdalton commented Jan 10, 2024

Test results for "tests 1"

1 failed ❌ [playwright-test] › basic.spec.ts:240:5 › should work with default export

test('should work with default export', async ({ runInlineTest }) => {
const result = await runInlineTest({
'file.spec.ts': `
import t from '@playwright/test';
t('passed', () => {
t.expect(1 + 1).toBe(2);
});
`
});
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
expect(result.failed).toBe(0);
});

The test is failing because:

import t from '@playwright/test'

is expecting t.test to exist but that is not how it's exported. See

export default playwright.test;

The playwright.test does not have test as a property (so no playwright.test.test) thought it does have playwrightFixtures:

export const test = _baseTest.extend<TestFixtures, WorkerFixtures>(playwrightFixtures);

This can be addressed if you wish by doing:

combinedExports.test = Object.assign(combinedExports.test, combinedExports);

In packages/playwright/test.js
OR

export default playwright;

in packages/playwright/test.mjs

OR both 😺

@pavelfeldman
Copy link
Member Author

Sounds good, I'll try with

module.exports = Object.assign(combinedExports.test, combinedExports);

Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › library/tracing.spec.ts:243:5 › should not include trace resources from the previous chunks

14852 passed, 310 skipped
✔️✔️✔️

Merge workflow run.

@pavelfeldman pavelfeldman merged commit 38822d1 into microsoft:main Jan 11, 2024
29 of 30 checks passed
@pavelfeldman pavelfeldman mentioned this pull request Jan 11, 2024
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.

3 participants