@vercel/sandbox@2.8.0
Patch Changes
-
Add
@vercel/sandbox-mock, a drop-in mock for@vercel/sandboxbacked byjust-bash. Rather than reimplementing the SDK surface, it runs the real@vercel/sandboxclasses against an in-memory implementation of the/v2/sandboxesHTTP API injected through the SDK'sfetchseam — so command execution, filesystem, multi-user/group management, snapshots, and forking all exercise the real SDK code. Commands run locally viajust-bashagainst an in-memory filesystem, andcommand()/setupSandbox()let tests stub the output of commandsjust-bashcan't run. (#245)As part of this,
Snapshot.getnow forwards a customfetch(viaWithFetchOptions), matchingSnapshot.listandSnapshot.tree. Previously it always used the globalfetch, so an injected client — such as the mock — could not intercept the request.