Run the standard sandbox integration tests against a provider.
A single shared sandbox is created in beforeAll and reused for the
majority of tests (command execution, file operations). Tests that
inherently need their own sandbox (lifecycle close/init, initialFiles)
create a temporary one and destroy it immediately, so the concurrent
sandbox count never exceeds 2 (shared + 1 temporary).
sandboxStandardTests<T extends SandboxInstance>(config: StandardTestsConfig<T>)| Name | Type | Description |
|---|---|---|
config* | StandardTestsConfig<T> |
import { sandboxStandardTests } from "@langchain/sandbox-standard-tests/vitest";
import { ModalSandbox } from "./sandbox.js";
sandboxStandardTests({
name: "ModalSandbox",
skip: !process.env.MODAL_TOKEN_ID,
timeout: 180_000,
createSandbox: (opts) =>
ModalSandbox.create({ imageName: "alpine:3.21", ...opts }),
createUninitializedSandbox: () =>
new ModalSandbox({ imageName: "alpine:3.21" }),
closeSandbox: (sb) => sb.close(),
resolvePath: (name) => `/tmp/${name}`,
});