Skip to content

test: read the Jest holdout list from one shared module - #10848

Merged
cryptodev-2s merged 1 commit into
test/vitest-setupfrom
test/vitest-shared-runner-list
Oct 15, 2026
Merged

cryptodev-2s merged 1 commit into
test/vitest-setupfrom
test/vitest-shared-runner-list

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

PACKAGES_ON_JEST lived in yarn.config.cjs while oxlint.config.ts worked the same fact out for itself by probing the filesystem for packages/*/vitest.config.mjs. Two sources of truth for one question, and they could disagree: a package listed as a Jest holdout that also has a vitest.config.mjs would get Vitest globs from oxlint while constraints demanded Jest scripts.

The list moves to test-runners.cjs and both read it. CommonJS, because yarn.config.cjs is CommonJS and has to require it; oxlint.config.ts reaches it with createRequire rather than relying on module interop. That also keeps the "do not add to this list" note next to the data it governs.

One deliberate loss: oxlint no longer discovers runners from disk, so it depends on the list being accurate. That is the point. Stripping the scope to get a directory name is safe because yarn.config.cjs already constrains every package to be named @metamask/${workspaceBasename}.

test-runners.cjs carries an import/unambiguous suppression, as every other .cjs file in the repo does.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
    • Not applicable, test only change. Carries the no-changelog label.
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
    • None.

Note

Low Risk
Config-only refactor for lint and Yarn constraints; wrong list entries could mis-apply Jest/Vitest Oxlint rules on test files but does not affect runtime product code.

Overview
Centralizes the Jest holdout package list in new test-runners.cjs so Yarn constraints and Oxlint agree on which packages still use Jest vs Vitest.

yarn.config.cjs drops its ~100-line inline PACKAGES_ON_JEST set and requires the shared module instead. oxlint.config.ts stops inferring runners from packages/*/vitest.config.mjs on disk and loads the same list via createRequire, then splits package dirs into Jest vs Vitest test globs from that data. An import/unambiguous suppression is added for the new .cjs file.

Reviewed by Cursor Bugbot for commit 9a8c252. Bugbot is set up for automated code reviews on this repo. Configure here.

@cryptodev-2s
cryptodev-2s changed the base branch from test/vitest-user-operation-controller to test/vitest-setup October 15, 2026 14:25
@cryptodev-2s
cryptodev-2s requested review from a team as code owners October 15, 2026 14:25
@cryptodev-2s
cryptodev-2s force-pushed the test/vitest-shared-runner-list branch from b61ad42 to 9a8c252 Compare October 15, 2026 14:27
@cryptodev-2s
cryptodev-2s merged commit aca5934 into test/vitest-setup Oct 15, 2026
345 checks passed
@cryptodev-2s
cryptodev-2s deleted the test/vitest-shared-runner-list branch October 15, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant