summaryrefslogtreecommitdiff
path: root/test/parallel/test-zlib-not-string-or-buffer.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-zlib-not-string-or-buffer.js')
-rw-r--r--test/parallel/test-zlib-not-string-or-buffer.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/parallel/test-zlib-not-string-or-buffer.js b/test/parallel/test-zlib-not-string-or-buffer.js
index 489bc07f5d..bf59e86d5c 100644
--- a/test/parallel/test-zlib-not-string-or-buffer.js
+++ b/test/parallel/test-zlib-not-string-or-buffer.js
@@ -6,14 +6,24 @@
const common = require('../common');
const zlib = require('zlib');
-[undefined, null, true, false, 0, 1, [1, 2, 3], { foo: 'bar' }].forEach((i) => {
+[
+ undefined,
+ null,
+ true,
+ false,
+ 0,
+ 1,
+ [1, 2, 3],
+ { foo: 'bar' }
+].forEach((input) => {
common.expectsError(
- () => zlib.deflateSync(i),
+ () => zlib.deflateSync(input),
{
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "buffer" argument must be one of type string, Buffer, ' +
- 'TypedArray, DataView, or ArrayBuffer'
+ 'TypedArray, DataView, or ArrayBuffer. ' +
+ `Received type ${typeof input}`
}
);
});