From ffe7e1ace04221b3393fc10fe8c3b64d14f69ace Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 11 Mar 2025 01:48:58 +0100 Subject: [PATCH] assert: mark partialDeepStrictEqual() as stable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current implementation is well tested, fast and handles all known edge cases properly. PR-URL: https://github.com/nodejs/node/pull/57370 Reviewed-By: Rafael Gonzaga Reviewed-By: Vinícius Lourenço Claro Cardoso --- doc/api/assert.md | 6 ++++-- lib/assert.js | 3 +-- test/parallel/test-assert-typedarray-deepequal.js | 5 ----- test/pseudo-tty/test-assert-colors.js | 1 - test/pseudo-tty/test-assert-no-color.js | 1 - 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index 555d78dcbc0..1de3d36537f 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -2587,10 +2587,12 @@ argument. -> Stability: 1.2 - Release candidate - * `actual` {any} * `expected` {any} * `message` {string|Error} diff --git a/lib/assert.js b/lib/assert.js index c0c4f026e68..657ac6225d9 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -54,7 +54,7 @@ const { isPromise, isRegExp, } = require('internal/util/types'); -const { isError, deprecate, emitExperimentalWarning } = require('internal/util'); +const { isError, deprecate } = require('internal/util'); const { innerOk } = require('internal/assert/utils'); const CallTracker = require('internal/assert/calltracker'); @@ -358,7 +358,6 @@ assert.partialDeepStrictEqual = function partialDeepStrictEqual( expected, message, ) { - emitExperimentalWarning('assert.partialDeepStrictEqual'); if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } diff --git a/test/parallel/test-assert-typedarray-deepequal.js b/test/parallel/test-assert-typedarray-deepequal.js index b2ed4c698b7..371e7161145 100644 --- a/test/parallel/test-assert-typedarray-deepequal.js +++ b/test/parallel/test-assert-typedarray-deepequal.js @@ -110,15 +110,10 @@ suite('notEqualArrayPairs', () => { makeBlock(assert.deepStrictEqual, arrayPair[0], arrayPair[1]), assert.AssertionError ); - // TODO(puskin94): remove emitWarning override once the partialDeepStrictEqual method is not experimental anymore - // Suppress warnings, necessary otherwise the tools/pseudo-tty.py runner will fail - const originalEmitWarning = process.emitWarning; - process.emitWarning = () => {}; assert.throws( makeBlock(assert.partialDeepStrictEqual, arrayPair[0], arrayPair[1]), assert.AssertionError ); - process.emitWarning = originalEmitWarning; // Restore original process.emitWarning }); } }); diff --git a/test/pseudo-tty/test-assert-colors.js b/test/pseudo-tty/test-assert-colors.js index 889e9a6e006..846326a9c49 100644 --- a/test/pseudo-tty/test-assert-colors.js +++ b/test/pseudo-tty/test-assert-colors.js @@ -1,4 +1,3 @@ -// Flags: --no-warnings 'use strict'; require('../common'); const assert = require('assert').strict; diff --git a/test/pseudo-tty/test-assert-no-color.js b/test/pseudo-tty/test-assert-no-color.js index c2e79d26701..d6765d6f06c 100644 --- a/test/pseudo-tty/test-assert-no-color.js +++ b/test/pseudo-tty/test-assert-no-color.js @@ -1,4 +1,3 @@ -// Flags: --no-warnings 'use strict'; require('../common'); const assert = require('assert').strict;