From 7eec4e3e6fe2b277d64ac3038cf4837008820312 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 5 Dec 2024 22:01:53 -0800 Subject: [PATCH] Fix assertions which would never fail due to how tests are called. --- GLOBALS.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GLOBALS.mjs b/GLOBALS.mjs index f5649ee..1b60059 100644 --- a/GLOBALS.mjs +++ b/GLOBALS.mjs @@ -66,9 +66,15 @@ export const assert = { return b != null }, equals: (a, b) => { + if (a !== b) { + throw new Error(`${a?.constructor?.name ?? typeof a} not equal to ${b?.constructor?.name ?? typeof b}`) + } return a === b }, notEqual: (a, b) => { + if (a === b) { + throw new Error(`${a?.constructor?.name ?? typeof a} equals ${b?.constructor?.name ?? typeof b}`) + } return a !== b }, rejects: async (fn, msg) => { -- 2.34.1