From 4852c2332840b0974e3febc779294d64c107d7c8 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Tue, 5 Mar 2024 05:04:03 +0100 Subject: [PATCH] chore: increase test coverage to 100% for /lib/api/api-request.js (#2912) --- test/node-test/client-errors.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/node-test/client-errors.js b/test/node-test/client-errors.js index 41389088425..8826bb9dc87 100644 --- a/test/node-test/client-errors.js +++ b/test/node-test/client-errors.js @@ -1056,7 +1056,7 @@ test('retry idempotent inflight', async (t) => { }) test('invalid opts', async (t) => { - const p = tspl(t, { plan: 2 }) + const p = tspl(t, { plan: 5 }) const client = new Client('http://localhost:5000') client.request(null, (err) => { @@ -1065,6 +1065,22 @@ test('invalid opts', async (t) => { client.pipeline(null).on('error', (err) => { p.ok(err instanceof errors.InvalidArgumentError) }) + client.request({ + path: '/', + method: 'GET', + highWaterMark: '1000' + }, (err) => { + p.ok(err instanceof errors.InvalidArgumentError) + p.strictEqual(err.message, 'invalid highWaterMark') + }) + client.request({ + path: '/', + method: 'GET', + highWaterMark: -1 + }, (err) => { + p.ok(err instanceof errors.InvalidArgumentError) + p.strictEqual(err.message, 'invalid highWaterMark') + }) await p.completed })