Skip to content
Permalink
Browse files

test: check that pending warning is emitted once

Code for the new --pending-deprecation flag contains logic to make sure
the deprecation warning is emitted only once. However, this was not
being tested. Add test coverage for this situation.

PR-URL: #12527
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
Trott authored and jasnell committed Apr 20, 2017
1 parent 6ee6aae commit 75bfdad0371444ec4aa69a6f60062d0d6f0fe9ad
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/parallel/test-buffer-pending-deprecation.js
@@ -12,4 +12,10 @@ const bufferWarning = 'The Buffer() and new Buffer() constructors are not ' +

common.expectWarning('DeprecationWarning', bufferWarning);

// This is used to make sure that a warning is only emitted once even though
// `new Buffer()` is called twice.
process.on('warning', common.mustCall());

new Buffer(10);

new Buffer(10);

0 comments on commit 75bfdad

Please sign in to comment.
You can’t perform that action at this time.