mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/58535 Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
22 lines
719 B
JavaScript
22 lines
719 B
JavaScript
// Flags: --expose-internals --no-warnings
|
|
|
|
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const httpCommon = require('internal/http/common');
|
|
const http = require('http');
|
|
|
|
[Symbol(), {}, [], () => {}, 1n, true, '1', null, undefined].forEach((value) => {
|
|
assert.throws(() => http.setMaxIdleHTTPParsers(value), { code: 'ERR_INVALID_ARG_TYPE' });
|
|
});
|
|
|
|
[-1, -Infinity, NaN, 0, 1.1].forEach((value) => {
|
|
assert.throws(() => http.setMaxIdleHTTPParsers(value), { code: 'ERR_OUT_OF_RANGE' });
|
|
});
|
|
|
|
[1, Number.MAX_SAFE_INTEGER].forEach((value) => {
|
|
assert.notStrictEqual(httpCommon.parsers.max, value);
|
|
http.setMaxIdleHTTPParsers(value);
|
|
assert.strictEqual(httpCommon.parsers.max, value);
|
|
});
|