From: Chris Duncan Date: Sat, 2 Aug 2025 08:53:13 +0000 (-0700) Subject: Fix assertions for expected failures. X-Git-Tag: v0.10.5~47^2~17 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=2f8a9c2d7454ee828cb2eb40073116f186a5f726;p=libnemo.git Fix assertions for expected failures. --- diff --git a/test/GLOBALS.mjs b/test/GLOBALS.mjs index cb2f957..863c60f 100644 --- a/test/GLOBALS.mjs +++ b/test/GLOBALS.mjs @@ -228,10 +228,10 @@ export const assert = { if (fn instanceof Promise) { try { await fn - throw new Error(msg ?? 'expected async function to reject') } catch (err) { return true } + throw new Error(msg ?? 'expected async function to reject') } else { throw new Error(msg ?? 'expected async function') } @@ -260,9 +260,9 @@ export const assert = { } try { fn() - throw new Error(msg ?? `expected function to throw an exception`) } catch (err) { return true } + throw new Error(msg ?? `expected function to throw an exception`) } }