Skip to content

Commit

Permalink
zlib: test BrotliCompress throws invalid arg value
Browse files Browse the repository at this point in the history
  • Loading branch information
RaisinTen committed Oct 28, 2020
1 parent 34810e0 commit a9ce812
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/parallel/test-zlib-invalid-arg-value-brotli-compress.js
@@ -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'
});

0 comments on commit a9ce812

Please sign in to comment.