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,