Files
Kmake/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js
2026-05-26 23:36:42 -07:00

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'
});