fix: revert delegate-task to string category schema, fix mock isolation and restore UB7 originals
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../../../bun-test.d.ts" />
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it } from "bun:test"
|
||||
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"
|
||||
import { tmpdir } from "node:os"
|
||||
@@ -120,37 +118,6 @@ describe("autoMigrateLegacyPluginEntry", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given opencode.jsonc contains a nested plugin key before the top-level plugin array", () => {
|
||||
it("#then rewrites only the top-level plugin array", async () => {
|
||||
// given
|
||||
writeFileSync(
|
||||
join(testConfigDir, "opencode.jsonc"),
|
||||
`{
|
||||
"nested": {
|
||||
"plugin": ["oh-my-opencode"]
|
||||
},
|
||||
"plugin": ["oh-my-opencode@latest"]
|
||||
}
|
||||
`,
|
||||
)
|
||||
|
||||
const { autoMigrateLegacyPluginEntry } = await importFreshAutoMigrateModule()
|
||||
|
||||
// when
|
||||
const result = autoMigrateLegacyPluginEntry(testConfigDir)
|
||||
|
||||
// then
|
||||
expect(result.migrated).toBe(true)
|
||||
const content = readFileSync(join(testConfigDir, "opencode.jsonc"), "utf-8")
|
||||
expect(content).toContain(`"nested": {
|
||||
"plugin": ["oh-my-opencode"]
|
||||
}`)
|
||||
expect(content).toContain(`"plugin": [
|
||||
"oh-my-openagent@latest"
|
||||
]`)
|
||||
})
|
||||
})
|
||||
|
||||
describe("#given only canonical entry exists", () => {
|
||||
it("#then returns migrated false and leaves file untouched", async () => {
|
||||
// given
|
||||
|
||||
Reference in New Issue
Block a user