Skip to content

test: pin module semantics of transpiled code - #43293

Merged
Pavel Feldman (pavelfeldman) merged 2 commits into
microsoft:mainfrom
pavelfeldman:transform-behavior-tests
Oct 12, 2026
Merged

Pavel Feldman (pavelfeldman) merged 2 commits into
microsoft:mainfrom
pavelfeldman:transform-behavior-tests

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Pin current transpilation behavior for writable exports, import cycles, generic arrows in .tsx and import.meta in CommonJS, so a transpiler change shows these differences.

import { run } from './greeter';

test('works', () => {
(util as any).greet = () => 'stub';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not sure we want to support that. IIUC, this is impossible with ESM anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All these will fail when moving to esbuild, but we need to be mindful about it.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, Playwright bot here — I reviewed the CI failures on head 980103689368ebb184e3365e33fc8a5e55c6a886.

🔴 The failure is caused by this PR

The newly added should reject import.meta in commonjs test fails on Node.js 20 because it expects a SyntaxError, but the run reports a different ReferenceError.

Details

This is the only real failure in the merged test report. The eight other entries are flaky tests that passed on retry, so they do not affect the verdict.

Caused by this PR

  • [playwright-test] › tests/playwright-test/babel.spec.ts:284 › should reject import.meta in commonjs — this test is added by the PR. On @ubuntu-latest-node20, it expects SyntaxError: Cannot use 'import.meta' outside a module, but receives ReferenceError: require is not defined in ES module scope, you can use import instead, followed by No tests found. The asserted error text does not match the behavior under this CI configuration.

Triaged by the Playwright bot - agent run

@github-actions

This comment has been minimized.

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 8baa5c2 into microsoft:main Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/webmcp.spec.ts:216 › should scope tools to their frame `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/video.spec.ts:294 › screencast › should capture navigation `@firefox-ubuntu-22.04-node20`

53316 passed, 1266 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/annotate.spec.ts:446 › should switch screencast to -s session on show --annotate @mcp-windows-latest-firefox

9164 passed, 1495 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, Playwright bot here — I reviewed the latest CI reports for PR head e7b2529108802a0997265bf90f58ddb424e6ac20.

🟢 The failure is a confirmed pre-existing flake

The only real failure in the latest reports is unrelated to this PR's transpiler tests. The same MCP test failed with the same assertion on an unrelated change.

Details

This PR changes only tests/playwright-test/babel.spec.ts. The latest tests 1 report has no failures; its five flaky tests passed on retry.

Pre-existing flake / infra

  • [firefox] › mcp/annotate.spec.ts:446 › should switch screencast to -s session on show --annotate on @mcp-windows-latest-firefox — this timed out while the selected session stayed "Session first" instead of "Session second". The same test and bot failed with the identical error on unrelated fix(reporter): merge json specs across projects regardless of cwd #43267 in MCP run 38042181491, attempt 2. In the refreshed test-results history, it passed in 20 of 22 Windows Firefox runs and failed in these two runs.

Triaged by the Playwright bot - agent run

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