Skip to content

feat(test-runner): respect useDefineForClassFields from tsconfig - #43262

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:babel-class-fields
Oct 12, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:babel-class-fields

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Compile TypeScript class fields like tsc: useDefineForClassFields from tsconfig, otherwise derived from target (defaults to true, as in TypeScript 6+).
  • Breaking: field initializers that read constructor parameter properties ([regression] 1.32 beta POMs don't work #21794) now need "useDefineForClassFields": false.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

6 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-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:725 › screencast › should capture full viewport on hidpi `@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`

53321 passed, 1266 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chromium] › mcp/http.spec.ts:92 › http transport browser lifecycle (isolated) @mcp-ubuntu-latest-chromium
❌ [firefox] › mcp/cli-core.spec.ts:276 › click button with role locator @mcp-windows-latest-firefox

9111 passed, 1495 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures.

🟢 Both failures are confirmed pre-existing flakes

The same tests fail with the same errors on unrelated SHAs, so these failures are unlikely to be caused by this PR.

Details

Pre-existing flakes

  • [chromium] › mcp/http.spec.ts:92 › http transport browser lifecycle (isolated) — timed out after 30 seconds. The same test had the same timeout in five earlier runs on unrelated changes: three runs on main (1, 2, 3), #43134, and #43175. In the recent test-results history, it failed 5 of 253 runs before this PR and passed the other 248.
  • [firefox] › mcp/cli-core.spec.ts:276 › click button with role locator — the click timed out while waiting for the Submit button, leaving clickSnapshot undefined. The same test failed with the same Received: undefined assertion on main at 3cf9b39. It passed the other 250 recent runs before this PR.

This PR changes TypeScript class-field transformation, but the exact failure signatures predate it. The primary test workflow had six retry-rescued flakes and no final failures, so they do not need triage.

Triaged by the Playwright bot - agent run

expect(result.passed).toBe(1);
});

for (const [compilerOptions, define] of [

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.

So many tests for such a small feature??

jsxImportSource?: string;
};
export type BabelTransformFunction = (code: string, filename: string, isModule: boolean, pluginsSuffix: BabelPlugin[], jsx?: JsxOptions) => BabelFileResult | null;
export type BabelTransformFunction = (code: string, filename: string, isModule: boolean, pluginsSuffix: BabelPlugin[], useDefineForClassFields: boolean, jsx?: JsxOptions) => BabelFileResult | null;

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 wonder whether it's time to define TransformOptions and use it across babelBundle and transform?

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