Repository navigation
test(cli): make the updater telemetry guard independent of the default stub #2249 - #2253
Merged
Merged
Conversation
…t stub #2249 Signed-off-by: Nik Cubrilovic <[email protected]>
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.
Follow-up to #2251, for #2249.
#2251 landed before its round 2. Its guard only checked URLs that the default
fetchstub recorded, so deletinginstallDefaultFetchStub()still passed 112/0. That missed #2249's criterion "Removing the default stub makes it fail" (a review-lane finding).This change:
globalThis.fetchis replaced with a recorder that logs the URL and throws, so it never touches the network.beforeEachinstalls the default stub and asserts it's in place (globalThis.fetch !== originalFetch).afterEachfails if anything reached the recorder. That covers a deleted stub, or a test that restores the real fetch mid-test.afterAllasserts the recorder is still the global, then hands the genuine fetch back so later files in the same Bun process aren't affected.Fail-befores (file by path):
SQUIRREL_API_SERVERline: 84 pass / 29 fail;installDefaultFetchStub(): 0 pass / 112 fail (it was 112 / 0 before this change).Gates: the file passes 112/0, the cli suite as CI runs it passes 4661/0, and tsgo, oxlint and oxfmt are clean. Test-only: no production code or docs change, and the agent skill needs no change.