Skip to content

Commit

Permalink
error logs are part of rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinse12 committed Sep 3, 2023
1 parent c081311 commit 102d58e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/test/test-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 102d58e

Please sign in to comment.