diff options
author | cjihrig <cjihrig@gmail.com> | 2019-01-07 13:19:49 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-01-10 09:00:17 -0500 |
commit | a665d13ad9fe40092be74d32652c1301b1db7550 (patch) | |
tree | 681840fed2173a0bc7a9fb5c322c6f07755c87ba /test | |
parent | 10df21b0714daae8ec9b1507e77bab7ae07e8fa7 (diff) | |
download | android-node-v8-a665d13ad9fe40092be74d32652c1301b1db7550.tar.gz android-node-v8-a665d13ad9fe40092be74d32652c1301b1db7550.tar.bz2 android-node-v8-a665d13ad9fe40092be74d32652c1301b1db7550.zip |
lib: move DEP0028 to end of life
PR-URL: https://github.com/nodejs/node/pull/25377
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/deprecated.js | 8 | ||||
-rw-r--r-- | test/parallel/test-util.js | 2 | ||||
-rw-r--r-- | test/sequential/test-deprecation-flags.js | 10 |
3 files changed, 11 insertions, 9 deletions
diff --git a/test/fixtures/deprecated.js b/test/fixtures/deprecated.js index f49c0d91ba..69d1ee2b0d 100644 --- a/test/fixtures/deprecated.js +++ b/test/fixtures/deprecated.js @@ -1 +1,7 @@ -require('util').debug('This is deprecated'); +'use strict'; +const util = require('util'); +const deprecated = util.deprecate(() => { + console.error('This is deprecated'); +}, 'this function is deprecated'); + +deprecated(); diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 54aaa4266f..28c4018d73 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -145,11 +145,9 @@ assert.strictEqual(util.isFunction(), false); assert.strictEqual(util.isFunction('string'), false); common.expectWarning('DeprecationWarning', [ - ['util.debug is deprecated. Use console.error instead.', 'DEP0028'], ['util.error is deprecated. Use console.error instead.', 'DEP0029'] ]); -util.debug('test'); util.error('test'); { diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index be159ceb38..dd41614f7f 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -44,7 +44,7 @@ execFile(node, normal, function(er, stdout, stderr) { console.error('normal: show deprecation warning'); assert.strictEqual(er, null); assert.strictEqual(stdout, ''); - assert(/util\.debug is deprecated/.test(stderr)); + assert(/this function is deprecated/.test(stderr)); console.log('normal ok'); }); @@ -52,7 +52,7 @@ execFile(node, noDep, function(er, stdout, stderr) { console.error('--no-deprecation: silence deprecations'); assert.strictEqual(er, null); assert.strictEqual(stdout, ''); - assert.strictEqual(stderr, 'DEBUG: This is deprecated\n'); + assert.strictEqual(stderr.trim(), 'This is deprecated'); console.log('silent ok'); }); @@ -62,10 +62,8 @@ execFile(node, traceDep, function(er, stdout, stderr) { assert.strictEqual(stdout, ''); const stack = stderr.trim().split('\n'); // just check the top and bottom. - assert( - /util\.debug is deprecated\. Use console\.error instead\./.test(stack[1]) - ); - assert(/DEBUG: This is deprecated/.test(stack[0])); + assert(/this function is deprecated/.test(stack[1])); + assert(/This is deprecated/.test(stack[0])); console.log('trace ok'); }); |