From 55b4cba5ad2be3c0a50c8edb57311844d657878b Mon Sep 17 00:00:00 2001 From: Aryan Jassal Date: Fri, 29 Nov 2024 17:21:04 +1100 Subject: [PATCH] fix: avoid generating invalid json objects using fastcheck --- tests/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils.ts b/tests/utils.ts index dc13f31..9aa14d2 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -83,11 +83,11 @@ const messagesToReadableStream = (messages: Array) => { */ const safeJsonValueArb = fc .json() - .map((value) => JSON.parse(value.replace('__proto__', 'proto')) as JSONValue) + .map((value) => JSON.parse(value.replaceAll('__proto__', 'proto')) as JSONValue) .noShrink(); const safeJsonObjectArb = fc.dictionary( - fc.string().map((s) => s.replace('__proto__', 'proto')), + fc.string().map((s) => s.replaceAll('__proto__', 'proto')), safeJsonValueArb, ) as fc.Arbitrary;