Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadf332b

Browse files
authored
assert: deprecate callTracker
PR-URL:#47740Fixes:#47492Reviewed-By: Erick Wendel <erick.workspace@gmail.com>Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>Reviewed-By: James M Snell <jasnell@gmail.com>
1 parentc968361 commitadf332b

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

‎doc/api/assert.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,18 @@ try {
221221
added:
222222
- v14.2.0
223223
- v12.19.0
224+
changes:
225+
- version: REPLACEME
226+
pr-url: https://github.com/nodejs/node/pull/47740
227+
description: the `assert.CallTracker` class has been deprecated and will be
228+
removed in a future version.
224229
-->
225230

226-
>Stability:1 -Experimental
231+
>Stability:0 -Deprecated
227232
228-
This feature is currently experimental and behavior might still change.
233+
This feature is deprecated and will be removed in a future version.
234+
Please consider using alternatives such as the
235+
[`mock`][] helper function.
229236

230237
###`new assert.CallTracker()`
231238

@@ -2559,6 +2566,7 @@ argument.
25592566
[`assert.strictEqual()`]:#assertstrictequalactual-expected-message
25602567
[`assert.throws()`]:#assertthrowsfn-error-message
25612568
[`getColorDepth()`]:tty.md#writestreamgetcolordepthenv
2569+
[`mock`]:test.md#mocking
25622570
[`process.on('exit')`]:process.md#event-exit
25632571
[`tracker.calls()`]:#trackercallsfn-exact
25642572
[`tracker.verify()`]:#trackerverify

‎doc/api/deprecations.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,6 +3363,21 @@ Type: Runtime
33633363
In a future version of Node.js, the`asyncResource` property will no longer
33643364
be added when a function is bound to an`AsyncResource`.
33653365

3366+
###DEP0173: the`assert.CallTracker` class
3367+
3368+
<!-- YAML
3369+
changes:
3370+
- version: REPLACEME
3371+
pr-url: https://github.com/nodejs/node/pull/47740
3372+
description: Documentation-only deprecation.
3373+
-->
3374+
3375+
Type: Documentation-only
3376+
3377+
In a future version of Node.js,[`assert.CallTracker`][],
3378+
will be removed.
3379+
Consider using alternatives such as the[`mock`][] helper function.
3380+
33663381
[NIST SP 800-38D]:https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
33673382
[RFC 6066]:https://tools.ietf.org/html/rfc6066#section-3
33683383
[RFC 8247 Section 2.4]:https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3386,6 +3401,7 @@ be added when a function is bound to an `AsyncResource`.
33863401
[`Server.listen({fd: <number>})`]:net.md#serverlistenhandle-backlog-callback
33873402
[`SlowBuffer`]:buffer.md#class-slowbuffer
33883403
[`WriteStream.open()`]:fs.md#class-fswritestream
3404+
[`assert.CallTracker`]:assert.md#class-assertcalltracker
33893405
[`assert`]:assert.md
33903406
[`asyncResource.runInAsyncScope()`]:async_context.md#asyncresourceruninasyncscopefn-thisarg-args
33913407
[`buffer.subarray`]:buffer.md#bufsubarraystart-end
@@ -3443,6 +3459,7 @@ be added when a function is bound to an `AsyncResource`.
34433459
[`message.socket`]:http.md#messagesocket
34443460
[`message.trailersDistinct`]:http.md#messagetrailersdistinct
34453461
[`message.trailers`]:http.md#messagetrailers
3462+
[`mock`]:test.md#mocking
34463463
[`module.createRequire()`]:module.md#modulecreaterequirefilename
34473464
[`os.networkInterfaces()`]:os.md#osnetworkinterfaces
34483465
[`os.tmpdir()`]:os.md#ostmpdir

‎lib/assert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const { inspect } = require('internal/util/inspect');
6666
const{ isPromise, isRegExp}=require('internal/util/types');
6767
const{EOL}=require('internal/constants');
6868
const{ BuiltinModule}=require('internal/bootstrap/realm');
69-
const{ isError}=require('internal/util');
69+
const{ isError, deprecate}=require('internal/util');
7070

7171
consterrorCache=newSafeMap();
7272
constCallTracker=require('internal/assert/calltracker');
@@ -1049,7 +1049,7 @@ assert.doesNotMatch = function doesNotMatch(string, regexp, message) {
10491049
internalMatch(string,regexp,message,doesNotMatch);
10501050
};
10511051

1052-
assert.CallTracker=CallTracker;
1052+
assert.CallTracker=deprecate(CallTracker,'assert.CallTracker is deprecated.','DEP0173');
10531053

10541054
/**
10551055
* Expose a strict only variant of assert.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp