There are multiple tests that use the same boilerplate to test that warnings are correctly emitted. This adds a new common function to do that and changes the tests to use it. PR-URL: https://github.com/nodejs/node/pull/8662 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
11 lines
319 B
JavaScript
11 lines
319 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const expected =
|
|
'Using Buffer without `new` will soon stop working. ' +
|
|
'Use `new Buffer()`, or preferably ' +
|
|
'`Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.';
|
|
common.expectWarning('DeprecationWarning', expected);
|
|
|
|
Buffer(1);
|
|
Buffer(1);
|