mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/8169 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>v7.x
Nikolai Vavilov
8 years ago
committed by
James M Snell
2 changed files with 27 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||
'use strict'; |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
const expected = |
|||
'Using Buffer without `new` will soon stop working. ' + |
|||
'Use `new Buffer()`, or preferably ' + |
|||
'`Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.'; |
|||
|
|||
process.on('warning', common.mustCall((warning) => { |
|||
assert.strictEqual(warning.name, 'DeprecationWarning'); |
|||
assert.strictEqual(warning.message, expected, |
|||
`unexpected error message: "${warning.message}"`); |
|||
}, 1)); |
|||
|
|||
Buffer(1); |
|||
Buffer(1); |
Loading…
Reference in new issue