# Test doubles by service The double to use for each service a test's `R` needs, or each kind of thing under test. A hand-written double encodes only what its author remembered, so use the one named here. For anything not listed, grep the kit's construct index with the router's command. | Service in `R`, or thing under test | Use | From | | --- | --- | --- | | `FileSystem` | `MemoryFileSystem.layerWith(seed)` — never `FileSystem.layerNoop` or a `node:fs` stub | `@effected/memfs` ([memfs](./memfs.md)) | | `Path` | `Path.layer` (POSIX) | `effect` | | `ChildProcessSpawner` | `ScriptedSpawner.make(script)`: `{ layer, spawns }` | `@effected/commands` | | the processes git starts itself (hooks, helpers, submodules), which no spawner double sees | `GitFixture.recordSpawns(effect, { config })` over git's trace2 stream (`GIT_TRACE2_EVENT`) ([false-greens](./false-greens.md)) | `@effected/git/testing` | | real `git` against local repositories, kept off the network | `GitFixture.layer` beside `Git.layer`: an isolated environment that allows only the `file` transport (`GIT_ALLOW_PROTOCOL=file`), so a remote derived by mistake fails `transport 'https' not allowed` instead of reaching a real host; widen it for one loopback suite with `GitFixture.runOptionsWith({ allowProtocol: ["file", "http"] })` | `@effected/git/testing` | | `HttpClient` | `HttpClient.make((request) => Effect.succeed(HttpClientResponse.fromWeb(request, new Response(body))))` in a `Layer.succeed(HttpClient.HttpClient, …)` | `effect/http` | | `Config` reads | `ConfigProvider.fromUnknown({ KEY: "value" })` — never `process.env` ([env-seam](./env-seam.md)) | `effect` | | `Clock`, `Schedule`, timeouts | `TestClock` (already installed by `it.effect`) | `effect/testing` | | `Stdio` | `Stdio.layerTest({ … })` | `effect` | | `Digest`, `Mac`, `Signature`, `SecureRandom` | the real layer, no double: `Digest.layerWebCrypto` (needs nothing), `Mac.layerWebCrypto` or `Signature.layerWebCrypto` with `Layer.provide(SecureRandom.layerWebCrypto)`, or `NodeCrypto.layerDigest` / `NodeCrypto.layer`. **`NodeServices.layer` provides no crypto service, `Digest` included** — only `ChildProcessSpawner`, `FileSystem`, `Path`, `Stdio` and `Terminal` — so a test or a standalone script that hashes composes `NodeCrypto.layerDigest` beside it | `effect/crypto`; `@effect/platform-node` | | a `Store`, or an app on `@effected/app` | `Store.layerTest({ migrations })`; `AppTest.layer(options)` | `@effected/store`; `@effected/app/testing` | | a CLI bin; an Ink screen | `CliTest`; `CliUiTest`, whose snapshot serializer is the one place a test uses `expect` ([CLIs](../../effect-cli-and-mcp/references/cli.md)) | `@effected/cli-kit/testing`; `@effected/cli-kit/ui/testing` | | an MCP server; an LSP server | `McpHarness`, `McpProbe` ([MCP servers](../../effect-cli-and-mcp/references/mcp.md)); `LspProbe` | `@effected/mcp-kit/testing`; `@effected/lsp/testing` | | a JWT or OIDC verifier | `TestIssuer` | `@effected/jwt/testing` | | an action, the GitHub API, an SBOM signer | the doubles in [testing actions](../../actions/references/testing.md) | `@effected/github-actions`, `@effected/github` | | a monorepo's own layering and packed installs | the repo-shape checks | `@effected/workspaces/testing` |