Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/helpers/matchers/Hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions tests/helpers/matchers/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down