Skip to content

Commit

Permalink
fix: reduce noice in test logs (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Jan 27, 2024
1 parent ab90244 commit c8b883d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/client-node-max-header-size.js
Original file line number Diff line number Diff line change
@@ -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()
})

0 comments on commit c8b883d

Please sign in to comment.