]> zoso.dev Git - libnemo.git/commitdiff
Fix assertions which would never fail due to how tests are called.
authorChris Duncan <chris@zoso.dev>
Fri, 6 Dec 2024 06:01:53 +0000 (22:01 -0800)
committerChris Duncan <chris@zoso.dev>
Fri, 6 Dec 2024 06:01:53 +0000 (22:01 -0800)
GLOBALS.mjs

index f5649ee828a9c67f384282d39d623357a3faca08..1b600593554050c4f56207fcb5e63c2b46d3f265 100644 (file)
@@ -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) => {