diff --git a/test/cli/install/bunx.test.ts b/test/cli/install/bunx.test.ts index ec0a9fb5a508..af9c67bfcab9 100644 --- a/test/cli/install/bunx.test.ts +++ b/test/cli/install/bunx.test.ts @@ -40,6 +40,107 @@ function pathWithout(name: string, PATH: string | undefined): string { .join(delimiter); } +// Cases that need bunx to install something get a per-test in-process registry +// serving throwaway packages: what they assert is bunx's own behavior (name -> +// bin resolution, the bunx cache, argument passthrough), and installing real +// packages made the file's cost scale with their dependency trees instead +// (@angular/cli alone was ~21k files per run to extract and, once the CI runner +// removes TMPDIR, delete again). dummy.registry's per-test contexts only serve +// the .tgz files checked in next to it, answer every package name with the same +// version list, and have no GitHub shape; these generate the tarballs instead, +// and `requests` lets a case prove that a second run came from the bunx cache. + +type FixturePackage = { + name: string; + version: string; + bin?: Record; + dependencies?: Record; + scripts?: Record; + /** Contents of the package besides its generated package.json. */ + files: Record; +}; + +/** A bin script that prints `