Normalize instance lifecycle wiring (#25501)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user