Jelajahi Sumber

test(opencode): port provider.test.ts to it.instance (#28565)

Kit Langton 4 bulan lalu
induk
melakukan
e0e8159965

+ 3 - 0
packages/opencode/src/provider/provider.ts

@@ -7,6 +7,7 @@ import * as Log from "@opencode-ai/core/util/log"
 import { Npm } from "@opencode-ai/core/npm"
 import { Npm } from "@opencode-ai/core/npm"
 import { Hash } from "@opencode-ai/core/util/hash"
 import { Hash } from "@opencode-ai/core/util/hash"
 import { Plugin } from "../plugin"
 import { Plugin } from "../plugin"
+import { serviceUse } from "@/effect/service-use"
 import { type LanguageModelV3 } from "@ai-sdk/provider"
 import { type LanguageModelV3 } from "@ai-sdk/provider"
 import * as ModelsDev from "@opencode-ai/core/models-dev"
 import * as ModelsDev from "@opencode-ai/core/models-dev"
 import { Auth } from "../auth"
 import { Auth } from "../auth"
@@ -1010,6 +1011,8 @@ interface State {
 
 
 export class Service extends Context.Service<Service, Interface>()("@opencode/Provider") {}
 export class Service extends Context.Service<Service, Interface>()("@opencode/Provider") {}
 
 
+export const use = serviceUse(Service)
+
 function cost(c: ModelsDev.Model["cost"]): Model["cost"] {
 function cost(c: ModelsDev.Model["cost"]): Model["cost"] {
   const result: Model["cost"] = {
   const result: Model["cost"] = {
     input: c?.input ?? 0,
     input: c?.input ?? 0,

File diff ditekan karena terlalu besar
+ 286 - 619
packages/opencode/test/provider/provider.test.ts


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini