Skip to content

Commit 102d7df

Browse files
RaisinTentargos
authored andcommitted
zlib: test BrotliCompress throws invalid arg value
PR-URL: #35830 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
1 parent d16e2fa commit 102d7df

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
// This test ensures that the BrotliCompress function throws
6+
// ERR_INVALID_ARG_TYPE when the values of the `params` key-value object are
7+
// neither numbers nor booleans.
8+
9+
const assert = require('assert');
10+
const { BrotliCompress, constants } = require('zlib');
11+
12+
const opts = {
13+
params: {
14+
[constants.BROTLI_PARAM_MODE]: 'lol'
15+
}
16+
};
17+
18+
assert.throws(() => BrotliCompress(opts), {
19+
code: 'ERR_INVALID_ARG_TYPE'
20+
});

0 commit comments

Comments
 (0)