Skip to content

Commit 49a26f8

Browse files
OttoAllmendingerllm-git
andcommitted
feat(utxo-lib): add assertEqualFixture utility function
This adds a helper to verify that a fixture matches an expected value. Issue: BTC-2652 Co-authored-by: llm-git <[email protected]>
1 parent 9507a6f commit 49a26f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/utxo-lib/test/fixture.util.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export async function readFixture<T>(path: string, defaultValue: T): Promise<T>
3838
}
3939
}
4040

41+
export async function assertEqualFixture<T>(path: string, a: T): Promise<void> {
42+
assert.deepStrictEqual(await readFixture(path, a), JSON.parse(toPrettyJSON(a)));
43+
}
44+
4145
/**
4246
* @param a
4347
* @param b

0 commit comments

Comments
 (0)