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
parent 790fb5b86f
commit 15537a41d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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))
}