mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 15:46:27 +00:00

Format commit wrapping lines containing RegEx and exceeding 80 chars. PR-URL: https://github.com/nodejs/node/pull/14607 Fixes: https://github.com/nodejs/node/issues/14586 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
21 lines
795 B
JavaScript
21 lines
795 B
JavaScript
'use strict';
|
|
|
|
// Check the error condition testing for passing something other than a string
|
|
// or buffer.
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const zlib = require('zlib');
|
|
|
|
const expected =
|
|
/^TypeError: "buffer" argument must be a string, Buffer, TypedArray, or DataView$/;
|
|
|
|
assert.throws(() => { zlib.deflateSync(undefined); }, expected);
|
|
assert.throws(() => { zlib.deflateSync(null); }, expected);
|
|
assert.throws(() => { zlib.deflateSync(true); }, expected);
|
|
assert.throws(() => { zlib.deflateSync(false); }, expected);
|
|
assert.throws(() => { zlib.deflateSync(0); }, expected);
|
|
assert.throws(() => { zlib.deflateSync(1); }, expected);
|
|
assert.throws(() => { zlib.deflateSync([1, 2, 3]); }, expected);
|
|
assert.throws(() => { zlib.deflateSync({ foo: 'bar' }); }, expected);
|