xref: /third_party/node/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_cirequire('../common');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci// This test ensures that the BrotliCompress function throws
61cb0ef41Sopenharmony_ci// ERR_INVALID_ARG_TYPE when the values of the `params` key-value object are
71cb0ef41Sopenharmony_ci// neither numbers nor booleans.
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst assert = require('assert');
101cb0ef41Sopenharmony_ciconst { BrotliCompress, constants } = require('zlib');
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ciconst opts = {
131cb0ef41Sopenharmony_ci  params: {
141cb0ef41Sopenharmony_ci    [constants.BROTLI_PARAM_MODE]: 'lol'
151cb0ef41Sopenharmony_ci  }
161cb0ef41Sopenharmony_ci};
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ciassert.throws(() => BrotliCompress(opts), {
191cb0ef41Sopenharmony_ci  code: 'ERR_INVALID_ARG_TYPE'
201cb0ef41Sopenharmony_ci});
21

Indexes created Thu Nov 07 10:32:03 CST 2024