Skip to content

Commit

Permalink
Make changeTokenBalance message consistent with changeEtherBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
schaable committed May 16, 2024
1 parent ef7ffef commit 9b98a50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export function supportChangeTokenBalance(
if (typeof balanceChange === "function") {
assert(
balanceChange(actualChange),
`Expected the balance of ${tokenDescription} tokens for "${address}" to satisfy the predicate, but it didn't (change by: ${actualChange.toString()} wei)`,
`Expected the balance of ${tokenDescription} tokens for "${address}" to NOT satisfy the predicate, but it did (change by: ${actualChange.toString()} wei)`
`Expected the balance of ${tokenDescription} tokens for "${address}" to satisfy the predicate, but it didn't (token balance change: ${actualChange.toString()} wei)`,
`Expected the balance of ${tokenDescription} tokens for "${address}" to NOT satisfy the predicate, but it did (token balance change: ${actualChange.toString()} wei)`
);
} else {
assert(
Expand Down
8 changes: 4 additions & 4 deletions packages/hardhat-chai-matchers/test/changeTokenBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe("INTEGRATION: changeTokenBalance and changeTokenBalances matchers", fun
)
).to.be.rejectedWith(
AssertionError,
/Expected the balance of MCK tokens for "0x\w{40}" to satisfy the predicate, but it didn't \(change by: 0 wei\)/
/Expected the balance of MCK tokens for "0x\w{40}" to satisfy the predicate, but it didn't \(token balance change: 0 wei\)/
);
});

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

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

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

Expand Down

0 comments on commit 9b98a50

Please sign in to comment.