From f5f232cc0084e8eb93f44673148f4635eb5c2338 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Sun, 3 Mar 2024 13:06:02 +0100 Subject: [PATCH] chore: increase test coverage to 100% for /lib/api/api-request.js --- 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 })