From 102d58ec477ab45e53913d3adccbb29810a8e7fe Mon Sep 17 00:00:00 2001 From: Rinse Date: Sun, 3 Sep 2023 16:35:06 +0000 Subject: [PATCH] error logs are part of rejection --- src/test/test-util.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/test-util.ts b/src/test/test-util.ts index c4844fa3..3e770ba6 100644 --- a/src/test/test-util.ts +++ b/src/test/test-util.ts @@ -362,12 +362,14 @@ export async function publishWithExpectedResult(publication: Publication, expect publication.once("challengeverification", (verificationMsg) => { receivedResponse = true; if (verificationMsg.challengeSuccess !== expectedChallengeSuccess) { - const msg = `Expected challengeSuccess to be (${expectedChallengeSuccess}) and got (${verificationMsg.challengeSuccess}). Reason (${verificationMsg.reason})`; - console.error(msg, verificationMsg); + const msg = `Expected challengeSuccess to be (${expectedChallengeSuccess}) and got (${ + verificationMsg.challengeSuccess + }). Reason (${verificationMsg.reason}): ${JSON.stringify(verificationMsg)}`; reject(msg); } else if (expectedReason && expectedReason !== verificationMsg.reason) { - const msg = `Expected reason to be (${expectedReason}) and got (${verificationMsg.reason})`; - console.error(msg, verificationMsg); + const msg = `Expected reason to be (${expectedReason}) and got (${verificationMsg.reason}): ${JSON.stringify( + verificationMsg + )}`; reject(msg); } else resolve(1); });