From 31ec8f860665eba5f5a0c793c29ddb2cf0ce68bd Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Tue, 4 Aug 2026 09:02:15 +0100 Subject: [PATCH] chore(cli): Change test assert to verify if a hash was returned instead of fix hash value. * Depending on environment it was build the hash will change making the test fail even though the dapp code template did not change. --- .../integration/exec/cartesi-machine-stored-hash.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/cli/tests/integration/exec/cartesi-machine-stored-hash.test.ts b/apps/cli/tests/integration/exec/cartesi-machine-stored-hash.test.ts index 48f78a40..31686b6d 100644 --- a/apps/cli/tests/integration/exec/cartesi-machine-stored-hash.test.ts +++ b/apps/cli/tests/integration/exec/cartesi-machine-stored-hash.test.ts @@ -2,6 +2,7 @@ import { afterAll, beforeAll, describe, expect, it } from "bun:test"; import { writeFileSync } from "node:fs"; import path from "node:path"; import tmp from "tmp"; +import { isHash } from "viem"; import { cartesiMachineStoredHash } from "../../../src/exec"; import { createTemporaryCartesiApplication, @@ -29,7 +30,7 @@ afterAll(() => { }); describe("cartesi-machine-stored-hash", () => { - it("should return the correct computed hash", async () => { + it("should return a computed hash", async () => { const machineHash = await cartesiMachineStoredHash.computeHash(".", { forceDocker: true, image: TEST_SDK, @@ -37,9 +38,7 @@ describe("cartesi-machine-stored-hash", () => { }); expect(machineHash).toBeDefined(); - expect(machineHash).toEqual( - "0xa4d4fd596e8220332f47c1005b7bd2d1b08ea007b6b2381a96512f9dc49458fa", - ); + expect(isHash(machineHash!)).toBeTrue(); }); it("should return undefined for a non-existent machine directory", async () => {