mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
zlib: test BrotliCompress throws invalid arg value
PR-URL: https://github.com/nodejs/node/pull/35830 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
This commit is contained in:
1 parent
1cb50c17d3
commit
f59e225675
1 file changed
+20
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
|
||||
// This test ensures that the BrotliCompress function throws
|
||||
// ERR_INVALID_ARG_TYPE when the values of the `params` key-value object are
|
||||
// neither numbers nor booleans.
|
||||
|
||||
const assert = require('assert');
|
||||
const { BrotliCompress, constants } = require('zlib');
|
||||
|
||||
const opts = {
|
||||
params: {
|
||||
[constants.BROTLI_PARAM_MODE]: 'lol'
|
||||
}
|
||||
};
|
||||
|
||||
assert.throws(() => BrotliCompress(opts), {
|
||||
code: 'ERR_INVALID_ARG_TYPE'
|
||||
});
|
||||
Reference in new issue
Block a user