fix(opencode): compare config snapshots as JSON (#45784)
Co-authored-by: jlongster <17031+jlongster@users.noreply.github.com>
This commit is contained in:
parent
790fb5b86f
commit
15537a41d2
1 changed files with 3 additions and 1 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue