mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-29 03:44:06 +08:00
test(cli): adapt upstream plugin fixture for Kilo
This commit is contained in:
@@ -56,13 +56,15 @@ async function defaultModel() {
|
||||
return run((provider) => provider.defaultModel())
|
||||
}
|
||||
|
||||
// kilocode_change start - upstream #24416 fixture adapted for @kilocode/plugin
|
||||
async function markPluginDependenciesReady(dir: string) {
|
||||
await mkdir(path.join(dir, "node_modules"), { recursive: true })
|
||||
await Bun.write(
|
||||
path.join(dir, "package-lock.json"),
|
||||
JSON.stringify({ packages: { "": { dependencies: { "@opencode-ai/plugin": "0.0.0" } } } }),
|
||||
JSON.stringify({ packages: { "": { dependencies: { "@kilocode/plugin": "0.0.0" } } } }),
|
||||
)
|
||||
}
|
||||
// kilocode_change end
|
||||
|
||||
function paid(providers: Awaited<ReturnType<typeof list>>) {
|
||||
const item = providers[ProviderID.make("opencode")]
|
||||
@@ -2492,11 +2494,13 @@ test("cloudflare-ai-gateway forwards config metadata options", async () => {
|
||||
test("plugin config providers persist after instance dispose", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
init: async (dir) => {
|
||||
// kilocode_change start - upstream #24416 avoids real plugin dependency installs
|
||||
const configDir = path.join(dir, ".opencode")
|
||||
const root = path.join(configDir, "plugin")
|
||||
await mkdir(root, { recursive: true })
|
||||
await markPluginDependenciesReady(configDir)
|
||||
await markPluginDependenciesReady(Global.Path.config)
|
||||
// kilocode_change end
|
||||
await Bun.write(
|
||||
path.join(root, "demo-provider.ts"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user