From f9b1949cada01f288ec16fa7fe48ae11c91f3615 Mon Sep 17 00:00:00 2001 From: rmc29 <151832398+rmc29@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:03:39 +0100 Subject: [PATCH] Fixed logic in "42" tests The logic in the "42" tests was backwards. It was checking that the number didn't equal 42, when it should check the number does equal 42. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 645a8dd4..ff612798 100644 --- a/README.md +++ b/README.md @@ -779,7 +779,7 @@ For instance this will work: let schema = number().test( 'is-42', "this isn't the number i want", - (value) => value != 42, + (value) => value === 42, ); schema.validateSync(23); // throws ValidationError @@ -789,7 +789,7 @@ however this will not: ```js let schema = number().test('is-42', "this isn't the number i want", (value) => - Promise.resolve(value != 42), + Promise.resolve(value === 42), ); schema.validateSync(42); // throws Error