Sha256: 1497150a759e2947c63c74dae561b66d14b0a8850a8d9b8509bd38f7dce95265

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 Bytes

Contents

'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: Not a string or buffer$/;

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);

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/test/parallel/test-zlib-not-string-or-buffer.js
node-compiler-0.9.0 vendor/node-v7.2.1/test/parallel/test-zlib-not-string-or-buffer.js
node-compiler-0.8.0 vendor/node-v7.2.0/test/parallel/test-zlib-not-string-or-buffer.js
node-compiler-0.7.0 vendor/node-v6.9.1/test/parallel/test-zlib-not-string-or-buffer.js
node-compiler-0.7.0 vendor/node-v7.1.0/test/parallel/test-zlib-not-string-or-buffer.js