refactor(opencode): roll out serviceUse proxy across 14 services + tests (#28576)
This commit is contained in:
@@ -175,7 +175,7 @@ mcpTest.instance("state() generates a new state when none is saved", () =>
|
||||
auth,
|
||||
)
|
||||
|
||||
const entryBefore = yield* McpAuth.Service.use((auth) => auth.get("test-state-gen"))
|
||||
const entryBefore = yield* McpAuth.use.get("test-state-gen")
|
||||
expect(entryBefore?.oauthState).toBeUndefined()
|
||||
|
||||
// state() should generate and return a new state, not throw
|
||||
@@ -184,7 +184,7 @@ mcpTest.instance("state() generates a new state when none is saved", () =>
|
||||
expect(state.length).toBe(64) // 32 bytes as hex
|
||||
|
||||
// The generated state should be persisted
|
||||
const entryAfter = yield* McpAuth.Service.use((auth) => auth.get("test-state-gen"))
|
||||
const entryAfter = yield* McpAuth.use.get("test-state-gen")
|
||||
expect(entryAfter?.oauthState).toBe(state)
|
||||
}),
|
||||
)
|
||||
@@ -202,7 +202,7 @@ mcpTest.instance("state() returns existing state when one is saved", () =>
|
||||
|
||||
// Pre-save a state
|
||||
const existingState = "pre-saved-state-value"
|
||||
yield* McpAuth.Service.use((auth) => auth.updateOAuthState("test-state-existing", existingState))
|
||||
yield* McpAuth.use.updateOAuthState("test-state-existing", existingState)
|
||||
|
||||
// state() should return the existing state
|
||||
const state = yield* Effect.promise(() => provider.state())
|
||||
|
||||
Reference in New Issue
Block a user