2016-09-15 21:11:44 +02:00
|
|
|
'use strict';
|
|
|
|
|
2019-12-25 18:02:16 +01:00
|
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
2016-09-15 21:11:44 +02:00
|
|
|
|
2019-12-25 18:02:16 +01:00
|
|
|
assert.throws(() => new Buffer(42, 'utf8'), {
|
2017-07-25 10:37:08 -07:00
|
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
2019-12-25 18:02:16 +01:00
|
|
|
name: 'TypeError',
|
2019-09-23 08:17:25 +02:00
|
|
|
message: 'The "string" argument must be of type string. Received type ' +
|
|
|
|
'number (42)'
|
2017-12-06 13:40:46 +05:30
|
|
|
});
|