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
/nodePublic
forked fromnodejs/node

Commitc27d39e

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

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

@@ -2555,6 +2562,7 @@ argument.
25552562
[`assert.strictEqual()`]:#assertstrictequalactual-expected-message
25562563
[`assert.throws()`]:#assertthrowsfn-error-message
25572564
[`getColorDepth()`]:tty.md#writestreamgetcolordepthenv
2565+
[`mock`]:test.md#mocking
25582566
[`process.on('exit')`]:process.md#event-exit
25592567
[`tracker.calls()`]:#trackercallsfn-exact
25602568
[`tracker.verify()`]:#trackerverify

‎doc/api/deprecations.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,6 +3318,21 @@ In a future version of Node.js, [`message.headers`][],
33183318
[`message.headersDistinct`][],[`message.trailers`][], and
33193319
[`message.trailersDistinct`][] will be read-only.
33203320

3321+
###DEP0173: the`assert.CallTracker` class
3322+
3323+
<!-- YAML
3324+
changes:
3325+
- version: REPLACEME
3326+
pr-url: https://github.com/nodejs/node/pull/47740
3327+
description: Documentation-only deprecation.
3328+
-->
3329+
3330+
Type: Documentation-only
3331+
3332+
In a future version of Node.js,[`assert.CallTracker`][],
3333+
will be removed.
3334+
Consider using alternatives such as the[`mock`][] helper function.
3335+
33213336
[NIST SP 800-38D]:https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
33223337
[RFC 6066]:https://tools.ietf.org/html/rfc6066#section-3
33233338
[RFC 8247 Section 2.4]:https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3341,6 +3356,7 @@ In a future version of Node.js, [`message.headers`][],
33413356
[`Server.listen({fd: <number>})`]:net.md#serverlistenhandle-backlog-callback
33423357
[`SlowBuffer`]:buffer.md#class-slowbuffer
33433358
[`WriteStream.open()`]:fs.md#class-fswritestream
3359+
[`assert.CallTracker`]:assert.md#class-assertcalltracker
33443360
[`assert`]:assert.md
33453361
[`asyncResource.runInAsyncScope()`]:async_context.md#asyncresourceruninasyncscopefn-thisarg-args
33463362
[`buffer.subarray`]:buffer.md#bufsubarraystart-end
@@ -3399,6 +3415,7 @@ In a future version of Node.js, [`message.headers`][],
33993415
[`message.socket`]:http.md#messagesocket
34003416
[`message.trailersDistinct`]:http.md#messagetrailersdistinct
34013417
[`message.trailers`]:http.md#messagetrailers
3418+
[`mock`]:test.md#mocking
34023419
[`module.createRequire()`]:module.md#modulecreaterequirefilename
34033420
[`os.networkInterfaces()`]:os.md#osnetworkinterfaces
34043421
[`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/loaders');
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