mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 05:25:19 +00:00
assert: mark partialDeepStrictEqual() as stable
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 <rafael.nunu@hotmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
This commit is contained in:
parent
ebbc5f7017
commit
d23b8a0cc4
@ -2594,9 +2594,13 @@ argument.
|
||||
added:
|
||||
- v23.4.0
|
||||
- v22.13.0
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/57370
|
||||
description: partialDeepStrictEqual is now Stable. Previously, it had been Experimental.
|
||||
-->
|
||||
|
||||
> Stability: 1.2 - Release candidate
|
||||
> Stability: 2 - Stable
|
||||
|
||||
* `actual` {any}
|
||||
* `expected` {any}
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -101,15 +101,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
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -1,4 +1,3 @@
|
||||
// Flags: --no-warnings
|
||||
'use strict';
|
||||
require('../common');
|
||||
const assert = require('assert').strict;
|
||||
|
@ -1,4 +1,3 @@
|
||||
// Flags: --no-warnings
|
||||
'use strict';
|
||||
require('../common');
|
||||
const assert = require('assert').strict;
|
||||
|
Loading…
Reference in New Issue
Block a user