Skip to content

Commit 7d68ef7

Browse files
committed
test(core): preserve probe service context
1 parent 0996db1 commit 7d68ef7

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎packages/core/test/plugin/provider-github-copilot.test.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,17 @@ describe("GithubCopilotPlugin", () => {
115115
HttpClient.HttpClient,
116116
Integration.Service,
117117
Config.Service,
118-
)(yield* Effect.context())
118+
)(
119+
yield* Effect.context<
120+
| Provider.Service
121+
| Bus.Service
122+
| Credential.Service
123+
| ManagedPolicy.Service
124+
| HttpClient.HttpClient
125+
| Integration.Service
126+
| Config.Service
127+
>(),
128+
)
119129
const synced = yield* Deferred.make<void>()
120130
yield* plugins.activate([
121131
{
@@ -136,8 +146,8 @@ describe("GithubCopilotPlugin", () => {
136146
...plugin,
137147
revision: "1",
138148
effect: (ctx) =>
139-
plugin
140-
.effect(
149+
Effect.gen(function* () {
150+
yield* plugin.effect(
141151
plugin.id === GithubCopilotPlugin.id
142152
? {
143153
...ctx,
@@ -149,7 +159,7 @@ describe("GithubCopilotPlugin", () => {
149159
}
150160
: ctx,
151161
)
152-
.pipe(Effect.provide(context)),
162+
}).pipe(Effect.provide(context)),
153163
}),
154164
),
155165
{ ...fromPromise({ id: "slow", setup: () => Effect.runPromise(Deferred.await(synced)) }), revision: "1" },
@@ -160,6 +170,7 @@ describe("GithubCopilotPlugin", () => {
160170
},
161171
])
162172
expect((yield* plugins.list()).every((plugin) => plugin.state.status === "active")).toBe(true)
173+
expect((yield* models.get(Provider.ID.githubCopilot, Model.ID.make("gpt-4.1")))?.limit.context).toBe(100000)
163174
expect((yield* models.available()).map((model) => model.id)).toContain(Model.ID.make("gpt-4.1"))
164175
}),
165176
)

0 commit comments

Comments
 (0)