Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 102d7df

Browse filesBrowse 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
Copy full SHA for 102d7df

File tree

Expand file treeCollapse file tree

1 file changed

+20
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+20
-0
lines changed
Open diff view settings
Collapse file
+20Lines changed: 20 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.