From 59ebe8081bf7ab561456c10381e6f601bf453716 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Mon, 23 Dec 2024 14:14:46 +0800 Subject: [PATCH] fix(expect): consistent `toBeCloseTo` assertion messages (#6291) --- expect/_matchers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/expect/_matchers.ts b/expect/_matchers.ts index 76c5f22cd8bb..98a024cd7233 100644 --- a/expect/_matchers.ts +++ b/expect/_matchers.ts @@ -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}` @@ -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}`