cloudaxe-opencode/packages/opencode/test/config/snapshot.ts
opencode-agent[bot] 15537a41d2
fix(opencode): compare config snapshots as JSON (#45784)
Co-authored-by: jlongster <17031+jlongster@users.noreply.github.com>
2026-08-27 20:08:12 -04:00

8 lines
359 B
TypeScript

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(value).toEqual(ConfigParse.jsonc(await Bun.file(file).text(), file))
}