Skip to content

Commit 75bfdad

Browse files
Trottjasnell
authored andcommitted
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 <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 6ee6aae commit 75bfdad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/parallel/test-buffer-pending-deprecation.js

+6
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@ const bufferWarning = 'The Buffer() and new Buffer() constructors are not ' +
1212

1313
common.expectWarning('DeprecationWarning', bufferWarning);
1414

15+
// This is used to make sure that a warning is only emitted once even though
16+
// `new Buffer()` is called twice.
17+
process.on('warning', common.mustCall());
18+
19+
new Buffer(10);
20+
1521
new Buffer(10);

0 commit comments

Comments
 (0)