Repository navigation
test: run tests outside src in the shared Vitest config - #10874
Open
cryptodev-2s wants to merge 1 commit into
Open
cryptodev-2s wants to merge 1 commit into
cryptodev-2s wants to merge 1 commit into
Conversation
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The shared Vitest config only includes
src/**/*.test.ts, but Jest's defaulttestMatchpicks up test files anywhere in a package. Seven packages still on Jest keep tests outsidesrc/, almost all of them in atests/directory, so migrating any of them would silently stop running those files while the suite still reported green.This came out of the
network-controllermigration, wheretests/holds 18463 lines across three files, roughly 70 percent of that package's suite. It needed a per packageincludeoverride to keep running them. Rather than have every such package rediscover that, the shared config now includestests/**/*.test.tsas well.Verified both directions. The eight packages already on Vitest are unaffected, since none has a
tests/directory containing test files, and all eight report the same counts as before. And a file placed intests/is genuinely picked up:base-controllergoes from 1 file and 74 tests to 2 files and 75 tests with a probe in place.Two packages will still need their own handling when their turn comes, and neither is made worse by this change.
wallet-clikeeps its end to end suite intests/and its unit config ignores that directory on purpose, so it will need to exclude it.wallet-framework-docskeeps a test undercontent/rather thantests/.References
Checklist
no-changeloglabel.Note
Low Risk
Test-runner configuration only; no runtime or API behavior changes.
Overview
Expands the shared package Vitest
includeglob so suites match Jest-style layouts: tests undersrc/still run, andtests/**/*.test.tsis picked up without per-package overrides.This avoids silently dropping large
tests/suites when migrating packages from Jest (e.g.network-controller), where most coverage can live outsidesrc/. Packages already on Vitest with onlysrc/tests are unchanged; packages that intentionally ignoretests/(e.g.wallet-cli) can still exclude that path locally when they migrate.Reviewed by Cursor Bugbot for commit 2799423. Bugbot is set up for automated code reviews on this repo. Configure here.