mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
74891412f1
PR-URL: https://github.com/nodejs/node/pull/15618 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
20 lines
511 B
JavaScript
20 lines
511 B
JavaScript
'use strict';
|
|
|
|
// Check the error condition testing for passing something other than a string
|
|
// or buffer.
|
|
|
|
const common = require('../common');
|
|
const zlib = require('zlib');
|
|
|
|
[undefined, null, true, false, 0, 1, [1, 2, 3], { foo: 'bar' }].forEach((i) => {
|
|
common.expectsError(
|
|
() => zlib.deflateSync(i),
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError,
|
|
message: 'The "buffer" argument must be one of type string, Buffer, ' +
|
|
'TypedArray, or DataView'
|
|
}
|
|
);
|
|
});
|