fix(opencode): compare config snapshots as JSON (#45784)

Co-authored-by: jlongster <17031+jlongster@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot]
2026-08-27 20:08:12 -04:00
committed by GitHub
co-authored by jlongster
parent 790fb5b86f
commit 15537a41d2
+3 -1
View File
@@ -1,6 +1,8 @@
import { expect } from "bun:test"
import { ConfigParse } from "../../src/config/parse"
export async function snapshot(file: string, actual: string) {
const value = ConfigParse.jsonc(actual, file)
if (process.env.UPDATE_CONFIG_FIXTURES === "1") await Bun.write(file, actual)
expect(actual).toBe(await Bun.file(file).text())
expect(value).toEqual(ConfigParse.jsonc(await Bun.file(file).text(), file))
}