Repository navigation
Conversation
Both fixtures have no node_modules folder, so auto-install is on. The import that each test expects to fail was asked of the configured npm registry first. Pass --no-install to those two spawns.
|
Updated 4:15 AM PT - Oct 19th, 2026
✅ @robobun, your commit dd327e570a5e00cf9705c75560a0edb8e7a1020e passed in 🧪 To try this PR locally: bunx bun-pr 46033That installs a local version of the PR into your bun-46033 --bun |
|
Status of #46033: how the problem was reproduced.
|
There was a problem hiding this comment.
LGTM, a two-line hermeticity fix for two negative-case spawns.
What was reviewed:
--no-installis a runtime param parsed in src/runtime/cli/Arguments.rs for bothbun run <file>andbun <file>; it sets GlobalCache::disable, so resolution falls through to the normal "Cannot find module" / "Cannot find package" error the assertions already check.- The
...flagssplice inrunWildcardScriptmatches the existing[bunExe(), ...flags, "index.js"]pattern in test/cli/run/run-autoinstall.test.ts; the other callers pass no flags and are unchanged. - The sibling negative test at test/js/bun/resolve/resolve.test.ts:1757 imports
#feature(a package.json subpath import), which is not an npm package name and never reaches auto-install, so it does not need the flag.
Extended reasoning...
The diff touches only two test files: it adds --no-install to one Bun.spawn command in test/cli/run/tsconfig-override.test.ts and adds a variadic flags parameter to the runWildcardScript helper in test/js/bun/resolve/resolve.test.ts, used by a single call site. No production code, security-sensitive surface, or assertion text changes. Both affected imports (@ helpers/math, types-only) are valid npm package names in fixtures without node_modules, so auto-install would otherwise contact the registry; with the flag the resolver's global_cache.can_use gate is false and the same resolution error is produced. The change is small, follows an existing in-tree pattern, and the one undrained-stdout pipe in the tsconfig-override test is pre-existing and not touched here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughTwo test fixtures now use ChangesFixture command behavior
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
Problem
.d.ts-only alias with no real module still reports the original specifier" intest/js/bun/resolve/resolve.test.tsand "should use custom tsconfig for path resolution" intest/cli/run/tsconfig-override.test.ts.node_modulesfolder, so auto-install is on. The import that the test expects to fail goes to the registry first. The result of the test then depends on the answer of the registry.Fix
--no-installto the two spawns that must fail.runWildcardScripttakes optional flags for that.Cannot find packageorCannot find moduleerror as before.bun bd testwhile a loopback registry logs the requests. On main the log has one request for each file. On this branch it has none.Background
node_modulesfolder up the tree, bun asks the registry for a bare import that it cannot resolve.--no-installturns that off.test/regression/issue/25622.test.tshas the same pattern. test: stop ten regression tests from contacting npm #37401 already changes that file.REVIEW.mdsays that a test must not contact a live registry.Behaviour change: none