Skip to content

Commit

Permalink
test(fetch): add client maxRequestsPerClient error test (nodejs#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlixWang authored and crysmags committed Feb 27, 2024
1 parent 306b144 commit 98df2ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/client-errors.js
Expand Up @@ -505,6 +505,14 @@ test('invalid options throws', (t) => {
t.equal(err.message, 'maxCachedSessions must be a positive integer or zero')
}

try {
new Client(new URL('http://localhost:200'), { maxRequestsPerClient: 'foo' }) // eslint-disable-line
t.fail()
} catch (err) {
t.type(err, errors.InvalidArgumentError)
t.equal(err.message, 'maxRequestsPerClient must be a positive number')
}

t.end()
})

Expand Down

0 comments on commit 98df2ea

Please sign in to comment.