diff --git a/tests/helpers/matchers/Hex.ts b/tests/helpers/matchers/Hex.ts index 4e513da2..7f5c3125 100644 --- a/tests/helpers/matchers/Hex.ts +++ b/tests/helpers/matchers/Hex.ts @@ -15,6 +15,7 @@ // limitations under the License. import { isHex } from 'viem' +import { isSkipCompare } from './skippable' /** * Reference the implementation of hexEqual in hardhat-chai-matchers. @@ -29,6 +30,10 @@ export function supportHexEqual(Assertion: Chai.AssertionStatic, utils: Chai.Cha // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access const isNegated = (this as any).__flags.negate === true + if (isSkipCompare(other)) { + return + } + // check that both values are proper hex strings for (const element of [subject, other]) { if (!isHex(element)) { diff --git a/tests/helpers/matchers/index.test.ts b/tests/helpers/matchers/index.test.ts index a0c88fdd..77a969e4 100644 --- a/tests/helpers/matchers/index.test.ts +++ b/tests/helpers/matchers/index.test.ts @@ -101,6 +101,7 @@ describe('matchers', () => { describe('skippable ', () => { it('skip compare', () => { expect('0x3').to.eq(skipCompare) + expect('0x3').to.hexEqual(skipCompare) expect('0x4e59b44847b379578588920cA78FbF26c0B4956C').to.be.eq(skipCompare) expect({ a: '0x3', b: 4n }).to.be.deep.eq(skipCompare) })