2026-08-27 20:03:36 +00:00
|
|
|
import { expect } from "bun:test"
|
2026-08-28 00:08:12 +00:00
|
|
|
import { ConfigParse } from "../../src/config/parse"
|
2026-08-27 20:03:36 +00:00
|
|
|
|
|
|
|
|
export async function snapshot(file: string, actual: string) {
|
2026-08-28 00:08:12 +00:00
|
|
|
const value = ConfigParse.jsonc(actual, file)
|
2026-08-27 20:03:36 +00:00
|
|
|
if (process.env.UPDATE_CONFIG_FIXTURES === "1") await Bun.write(file, actual)
|
2026-08-28 00:08:12 +00:00
|
|
|
expect(value).toEqual(ConfigParse.jsonc(await Bun.file(file).text(), file))
|
2026-08-27 20:03:36 +00:00
|
|
|
}
|