From 9beb60071b432cea9fcda60b244a4c3c637252c9 Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Tue, 5 Mar 2019 16:30:05 +0000 Subject: [PATCH] Check whether the code expectation was given --- lib/assert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/assert.js b/lib/assert.js index 0b4c74aeb..3e0cb7037 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -215,7 +215,7 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s }); } - if (actual.code !== expectations.code) { + if (typeof expectations.code !== 'undefined' && actual.code !== expectations.code) { throw new AssertionError({ assertion, message,