From c8b883d51ab03743a83e0d54f7c616c564904b7e Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Sat, 27 Jan 2024 18:26:30 +0100 Subject: [PATCH] fix: reduce noice in test logs (#2654) --- test/client-node-max-header-size.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/client-node-max-header-size.js b/test/client-node-max-header-size.js index b4bd6280249..227f6705084 100644 --- a/test/client-node-max-header-size.js +++ b/test/client-node-max-header-size.js @@ -1,22 +1,21 @@ 'use strict' const { execSync } = require('node:child_process') -const { test } = require('tap') +const { throws, doesNotThrow } = require('node:assert') +const { test } = require('node:test') const command = 'node -e "require(\'.\').request(\'https://httpbin.org/get\')"' -test("respect Node.js' --max-http-header-size", async (t) => { - t.throws( - () => execSync(`${command} --max-http-header-size=1`), +test("respect Node.js' --max-http-header-size", () => { + throws( + () => execSync(`${command} --max-http-header-size=1`, { stdio: 'pipe' }), /UND_ERR_HEADERS_OVERFLOW/, 'max-http-header-size=1 should throw' ) - t.doesNotThrow( + doesNotThrow( () => execSync(command), /UND_ERR_HEADERS_OVERFLOW/, 'default max-http-header-size should not throw' ) - - t.end() })