mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 16:22:29 +00:00

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>
45 lines
851 B
JavaScript
45 lines
851 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const zlib = require('zlib');
|
|
|
|
assert.doesNotThrow(() => {
|
|
zlib.createGzip({ flush: zlib.constants.Z_SYNC_FLUSH });
|
|
});
|
|
|
|
common.expectsError(
|
|
() => zlib.createGzip({ flush: 'foobar' }),
|
|
{
|
|
code: 'ERR_INVALID_OPT_VALUE',
|
|
type: RangeError
|
|
}
|
|
);
|
|
|
|
common.expectsError(
|
|
() => zlib.createGzip({ flush: 10000 }),
|
|
{
|
|
code: 'ERR_INVALID_OPT_VALUE',
|
|
type: RangeError
|
|
}
|
|
);
|
|
|
|
assert.doesNotThrow(() => {
|
|
zlib.createGzip({ finishFlush: zlib.constants.Z_SYNC_FLUSH });
|
|
});
|
|
|
|
common.expectsError(
|
|
() => zlib.createGzip({ finishFlush: 'foobar' }),
|
|
{
|
|
code: 'ERR_INVALID_OPT_VALUE',
|
|
type: RangeError
|
|
}
|
|
);
|
|
|
|
common.expectsError(
|
|
() => zlib.createGzip({ finishFlush: 10000 }),
|
|
{
|
|
code: 'ERR_INVALID_OPT_VALUE',
|
|
type: RangeError
|
|
}
|
|
);
|