From be8439b69b41e06f54a8e398a272879db918ed69 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Wed, 18 Dec 2024 08:57:11 -0500 Subject: [PATCH] test: Updated `match` to fail if you pass in an object that lacks the expected keys --- test/lib/custom-assertions/match.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lib/custom-assertions/match.js b/test/lib/custom-assertions/match.js index 27b2f8ef20..a65008e2a6 100644 --- a/test/lib/custom-assertions/match.js +++ b/test/lib/custom-assertions/match.js @@ -60,6 +60,8 @@ module.exports = function match(actual, expected, { assert = require('node:asser } else { assert.equal(actual[key], expected[key]) } + } else { + assert.fail(`Missing ${key} in ${JSON.stringify(actual)}`) } } }