From 71f92e3ace06f42fc11c3e2d3900a8bed207fb82 Mon Sep 17 00:00:00 2001 From: Alexander Mykolaichuk Date: Mon, 8 Jun 2020 09:42:59 +0200 Subject: [PATCH] improved test coverage (#1222) --- test/unit/connection.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/connection.test.js b/test/unit/connection.test.js index 68ffebbda..307d7b7d8 100644 --- a/test/unit/connection.test.js +++ b/test/unit/connection.test.js @@ -900,3 +900,18 @@ test('Abort a request asyncronously', t => { setImmediate(() => request.abort()) }) }) + +test('Should correctly resolve request pathname', t => { + t.plan(1) + + const connection = new Connection({ + url: new URL(`http://localhost:80/test`) + }) + + t.strictEqual( + connection.buildRequestObject({ + path: 'hello' + }).pathname, + '/test/hello' + ) +})