Skip to content

Commit

Permalink
improve test asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Sep 15, 2024
1 parent 778e75b commit cc37895
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/fireproof/hello.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe("Simplified Reopening a database", function () {
const metaGetResultOk = metaGetResult?.Ok();
const decodedMetaGetResultOk = new TextDecoder().decode(metaGetResultOk);
// console.log("decodedMetaGetResultOk", decodedMetaGetResultOk);
customExpect(decodedMetaGetResultOk, (v) => expect(v).toContain("parents"), "metaGetResult should contain 'parents'");
expect(decodedMetaGetResultOk).toContain("parents");

// return;

Expand Down Expand Up @@ -239,7 +239,7 @@ describe("Simplified Reopening a database", function () {
const walEncoder = new TextEncoder();
const walTestData = walEncoder.encode(walTestDataString);

// console.log("walTestData", walTestData);
// console.log(" walTestData", walTestDataString);

const walPutResult = await walGateway?.put(walUrl?.Ok(), walTestData);
expect(walPutResult?.Ok()).toBeFalsy();
Expand All @@ -252,11 +252,7 @@ describe("Simplified Reopening a database", function () {

// console.log("walGetResult", decodedResult);

customExpect(
decodedResult,
(v) => expect(v).toEqual(walTestDataString),
"Custom message: walGetResult should match walTestData",
);
expect(decodedResult).toEqual(walTestDataString);

const walDeleteResult = await walGateway?.delete(walUrl?.Ok());
expect(walDeleteResult?.Ok()).toBeFalsy();
Expand Down

0 comments on commit cc37895

Please sign in to comment.