Skip to content

Add support for import.meta.* in Jest through AST transform. - #40206

Open
goodov wants to merge 1 commit into
masterfrom
jest-ts-import-meta-transform
Open

goodov wants to merge 1 commit into
masterfrom
jest-ts-import-meta-transform

Conversation

@goodov

@goodov goodov commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Allow import.meta.* to be used freely in build/commands and other parts of the codebase by rewriting to matching CommonJS idioms. This allows Jest to properly handle those statements in imported files.

The right way to support import.meta.* in Jest is by enabling --experimental-vm-modules when running tests, but I'm not that confident we should go this path now, this flag is still experimental even in Node 26 and might introduce another layer of problems that we don't really want to deal with.

@goodov goodov added the CI/skip-origin Do not run CI builds for Origin label Sep 24, 2026
@github-actions github-actions Bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

📋 Code Owners Summary

9 file(s) changed, 5 with assigned owners

1 team(s) affected: @brave/build-commands-reviewers


Owners and Their Files

@brave/build-commands-reviewers — 5 file(s)

@brave-builds

Copy link
Copy Markdown
Collaborator

A Storybook has been deployed to preview UI for the latest push

@goodov
goodov force-pushed the jest-ts-import-meta-transform branch from 412b8b8 to 83d896b Compare September 25, 2026 06:01
@goodov
goodov marked this pull request as ready for review September 25, 2026 08:04
@goodov
goodov requested a review from a team as a code owner September 25, 2026 08:04
bbondy
bbondy previously approved these changes Sep 25, 2026
@bbondy
bbondy dismissed their stale review September 25, 2026 23:53

Approval was posted from the wrong account.

@github-actions

Copy link
Copy Markdown
Contributor

Chromium major version is behind target branch (154.0.8037.58 vs 155.0.8059.16). Please rebase.

@github-actions github-actions Bot added the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch CI/skip-origin Do not run CI builds for Origin CI/storybook-url Deploy storybook and provide a unique URL for each build QA/No release-notes/exclude

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants