Skip to content

Commit 4852c23

Browse files
authored
chore: increase test coverage to 100% for /lib/api/api-request.js (#2912)
1 parent f4ca0be commit 4852c23

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/node-test/client-errors.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ test('retry idempotent inflight', async (t) => {
10561056
})
10571057

10581058
test('invalid opts', async (t) => {
1059-
const p = tspl(t, { plan: 2 })
1059+
const p = tspl(t, { plan: 5 })
10601060

10611061
const client = new Client('http://localhost:5000')
10621062
client.request(null, (err) => {
@@ -1065,6 +1065,22 @@ test('invalid opts', async (t) => {
10651065
client.pipeline(null).on('error', (err) => {
10661066
p.ok(err instanceof errors.InvalidArgumentError)
10671067
})
1068+
client.request({
1069+
path: '/',
1070+
method: 'GET',
1071+
highWaterMark: '1000'
1072+
}, (err) => {
1073+
p.ok(err instanceof errors.InvalidArgumentError)
1074+
p.strictEqual(err.message, 'invalid highWaterMark')
1075+
})
1076+
client.request({
1077+
path: '/',
1078+
method: 'GET',
1079+
highWaterMark: -1
1080+
}, (err) => {
1081+
p.ok(err instanceof errors.InvalidArgumentError)
1082+
p.strictEqual(err.message, 'invalid highWaterMark')
1083+
})
10681084

10691085
await p.completed
10701086
})

0 commit comments

Comments
 (0)