mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 14:25:18 +00:00

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>
21 lines
455 B
JavaScript
21 lines
455 B
JavaScript
'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'
|
|
});
|