Skip to content

Commit

Permalink
fix(expect): consistent toBeCloseTo assertion messages (#6291)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored Dec 23, 2024
1 parent d625a03 commit 59ebe80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions expect/_matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function toBeCloseTo(
if (context.isNot) {
if (pass) {
const defaultMessage =
`Expected the value not to be close to ${expected} (using ${numDigits} digits), but it is`;
`Expected the value ${value} not to be close to ${expected} (using ${numDigits} digits), but it is`;
throw new AssertionError(
context.customMessage
? `${context.customMessage}: ${defaultMessage}`
Expand All @@ -99,7 +99,7 @@ export function toBeCloseTo(
} else {
if (!pass) {
const defaultMessage =
`Expected the value (${value} to be close to ${expected} (using ${numDigits} digits), but it is not`;
`Expected the value ${value} to be close to ${expected} (using ${numDigits} digits), but it is not`;
throw new AssertionError(
context.customMessage
? `${context.customMessage}: ${defaultMessage}`
Expand Down

0 comments on commit 59ebe80

Please sign in to comment.