Skip to content

Commit 9b98a50

Browse files
committed
Make changeTokenBalance message consistent with changeEtherBalance
1 parent ef7ffef commit 9b98a50

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/hardhat-chai-matchers/src/internal/changeTokenBalance.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export function supportChangeTokenBalance(
6969
if (typeof balanceChange === "function") {
7070
assert(
7171
balanceChange(actualChange),
72-
`Expected the balance of ${tokenDescription} tokens for "${address}" to satisfy the predicate, but it didn't (change by: ${actualChange.toString()} wei)`,
73-
`Expected the balance of ${tokenDescription} tokens for "${address}" to NOT satisfy the predicate, but it did (change by: ${actualChange.toString()} wei)`
72+
`Expected the balance of ${tokenDescription} tokens for "${address}" to satisfy the predicate, but it didn't (token balance change: ${actualChange.toString()} wei)`,
73+
`Expected the balance of ${tokenDescription} tokens for "${address}" to NOT satisfy the predicate, but it did (token balance change: ${actualChange.toString()} wei)`
7474
);
7575
} else {
7676
assert(

packages/hardhat-chai-matchers/test/changeTokenBalance.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ describe("INTEGRATION: changeTokenBalance and changeTokenBalances matchers", fun
169169
)
170170
).to.be.rejectedWith(
171171
AssertionError,
172-
/Expected the balance of MCK tokens for "0x\w{40}" to satisfy the predicate, but it didn't \(change by: 0 wei\)/
172+
/Expected the balance of MCK tokens for "0x\w{40}" to satisfy the predicate, but it didn't \(token balance change: 0 wei\)/
173173
);
174174
});
175175

@@ -195,7 +195,7 @@ describe("INTEGRATION: changeTokenBalance and changeTokenBalances matchers", fun
195195
)
196196
).to.be.rejectedWith(
197197
AssertionError,
198-
/Expected the balance of MCK tokens for "0x\w{40}" to NOT satisfy the predicate, but it did \(change by: 0 wei\)/
198+
/Expected the balance of MCK tokens for "0x\w{40}" to NOT satisfy the predicate, but it did \(token balance change: 0 wei\)/
199199
);
200200
});
201201

@@ -395,7 +395,7 @@ describe("INTEGRATION: changeTokenBalance and changeTokenBalances matchers", fun
395395
)
396396
).to.be.rejectedWith(
397397
AssertionError,
398-
/Expected the balance of MCK tokens for "0x\w{40}" to satisfy the predicate, but it didn't \(change by: 50 wei\)/
398+
/Expected the balance of MCK tokens for "0x\w{40}" to satisfy the predicate, but it didn't \(token balance change: 50 wei\)/
399399
);
400400
});
401401

@@ -421,7 +421,7 @@ describe("INTEGRATION: changeTokenBalance and changeTokenBalances matchers", fun
421421
)
422422
).to.be.rejectedWith(
423423
AssertionError,
424-
/Expected the balance of MCK tokens for "0x\w{40}" to NOT satisfy the predicate, but it did \(change by: 50 wei\)/
424+
/Expected the balance of MCK tokens for "0x\w{40}" to NOT satisfy the predicate, but it did \(token balance change: 50 wei\)/
425425
);
426426
});
427427

0 commit comments

Comments
 (0)