diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 738a4b605d2669..0f46a7fbfa77c7 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -56,6 +56,9 @@ rules: - object: assert property: deepEqual message: Use assert.deepStrictEqual(). + - object: assert + property: notDeepEqual + message: Use assert.notDeepStrictEqual(). - object: assert property: equal message: Use assert.strictEqual() rather than assert.equal(). diff --git a/lib/assert.js b/lib/assert.js index 304618fb3d4d26..1f506b7c7502bd 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -101,13 +101,6 @@ assert.deepEqual = function deepEqual(actual, expected, message) { innerFail(actual, expected, message, 'deepEqual', deepEqual); } }; -/* eslint-enable */ - -assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { - if (!isDeepStrictEqual(actual, expected)) { - innerFail(actual, expected, message, 'deepStrictEqual', deepStrictEqual); - } -}; // The non-equivalence assertion tests for any deep inequality. assert.notDeepEqual = function notDeepEqual(actual, expected, message) { @@ -115,6 +108,13 @@ assert.notDeepEqual = function notDeepEqual(actual, expected, message) { innerFail(actual, expected, message, 'notDeepEqual', notDeepEqual); } }; +/* eslint-enable */ + +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!isDeepStrictEqual(actual, expected)) { + innerFail(actual, expected, message, 'deepStrictEqual', deepStrictEqual); + } +}; assert.notDeepStrictEqual = notDeepStrictEqual; function notDeepStrictEqual(actual, expected, message) {