xref: /third_party/node/test/parallel/test-http-set-max-idle-http-parser.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ciconst httpCommon = require('_http_common');
51cb0ef41Sopenharmony_ciconst http = require('http');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci[Symbol(), {}, [], () => {}, 1n, true, '1', null, undefined].forEach((value) => {
81cb0ef41Sopenharmony_ci  assert.throws(() => http.setMaxIdleHTTPParsers(value), { code: 'ERR_INVALID_ARG_TYPE' });
91cb0ef41Sopenharmony_ci});
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci[-1, -Infinity, NaN, 0, 1.1].forEach((value) => {
121cb0ef41Sopenharmony_ci  assert.throws(() => http.setMaxIdleHTTPParsers(value), { code: 'ERR_OUT_OF_RANGE' });
131cb0ef41Sopenharmony_ci});
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci[1, Number.MAX_SAFE_INTEGER].forEach((value) => {
161cb0ef41Sopenharmony_ci  assert.notStrictEqual(httpCommon.parsers.max, value);
171cb0ef41Sopenharmony_ci  http.setMaxIdleHTTPParsers(value);
181cb0ef41Sopenharmony_ci  assert.strictEqual(httpCommon.parsers.max, value);
191cb0ef41Sopenharmony_ci});
20

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