mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
There is actually no reason to use `assert.doesNotThrow()` in the tests. If a test throws, just let the error bubble up right away instead of first catching it and then rethrowing it. Backport-PR-URL: https://github.com/nodejs/node/pull/19244 PR-URL: https://github.com/nodejs/node/pull/18669 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
40 lines
749 B
JavaScript
40 lines
749 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const zlib = require('zlib');
|
|
|
|
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
|
|
}
|
|
);
|
|
|
|
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
|
|
}
|
|
);
|