Skip to content

Commit

Permalink
test: check that pending warning is emitted once
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and jasnell committed Apr 24, 2017
1 parent 6ee6aae commit 75bfdad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-buffer-pending-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.