Normalize instance lifecycle wiring (#25501)

This commit is contained in:
Kit Langton
2026-05-02 20:39:20 -04:00
committed by GitHub
parent a6464062b7
commit 7d91d3b1ed
71 changed files with 852 additions and 936 deletions

View File

@@ -48,6 +48,7 @@ beforeEach(() => {
const { MCP } = await import("../../src/mcp/index")
const { AppRuntime } = await import("../../src/effect/app-runtime")
const { Instance } = await import("../../src/project/instance")
const { WithInstance } = await import("../../src/project/with-instance")
const { tmpdir } = await import("../fixture/fixture")
const service = MCP.Service as unknown as Effect.Effect<MCPNS.Interface, never, never>
@@ -73,7 +74,7 @@ test("headers are passed to transports when oauth is enabled (default)", async (
},
})
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
// Trigger MCP initialization - it will fail to connect but we can check the transport options
@@ -112,7 +113,7 @@ test("headers are passed to transports when oauth is enabled (default)", async (
test("headers are passed to transports when oauth is explicitly disabled", async () => {
await using tmp = await tmpdir()
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
transportCalls.length = 0
@@ -150,7 +151,7 @@ test("headers are passed to transports when oauth is explicitly disabled", async
test("no requestInit when headers are not provided", async () => {
await using tmp = await tmpdir()
await Instance.provide({
await WithInstance.provide({
directory: tmp.path,
fn: async () => {
transportCalls.length = 0