test(ci): restore global fetch in shared vitest setup#131
Merged
Conversation
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.
Summary
Tighten shared Vitest fetch cleanup so cross-test fetch leakage is cleaned up without breaking intentional suite-level fetch setup.
What changed
Updated:
test/setup.tsThe shared test bootstrap now:
globalThis.fetchat the start of each testglobalThis.fetchto that per-test starting value after each testWhy this patch
A broad macOS CI failure pattern pointed to shared test-state leakage. One proven leak vector was manual
globalThis.fetchmutation across suites.The first bootstrap fix restored fetch to the process-original value, but that was too blunt for suites that intentionally install a fetch mock in
beforeAll.This refined version preserves suite-level setup while still cleaning up per-test leakage.
Scope
Changed only:
test/setup.tsDid not change:
Behavior
No product behavior changed.
This is a shared test-bootstrap isolation fix only.
Validation
Passed:
pnpm vitest run src/cli/program.nodes-media.test.tspnpm vitest run src/telegram/send.test.ts src/telegram/fetch.test.tsResult:
program.nodes-mediapassed (9 tests)telegram/send+telegram/fetchpassed (62 tests)Notes
This patch is intentionally narrow:
Other possible shared isolation seams may still exist, but they are out of scope for this patch.