• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

digipolisantwerp / request_log_module_nodejs / 17791628274

17 Sep 2025 08:30AM UTC coverage: 91.667% (-8.3%) from 100.0%
17791628274

Pull #22

github

web-flow
Merge d5ce307f6 into d55998b9d
Pull Request #22: Complete features for fetch, remove axios

115 of 122 branches covered (94.26%)

Branch coverage included in aggregate %.

35 of 35 new or added lines in 2 files covered. (100.0%)

41 existing lines in 2 files now uncovered.

413 of 454 relevant lines covered (90.97%)

400.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.03
/lib/helpers/requestdecoder.js
1
const { URL } = require('url');
4✔
2

4✔
3
const getHost = (options) => {
4✔
4
  let host = `${options.hostname || options.host}`;
20✔
5
  if (options.port) host += `:${options.port}`;
20✔
6
  return host;
20✔
7
};
4✔
8

4✔
9
function makeUrl(url) {
32✔
10
  if (url.constructor.name === 'URL') return url;
32✔
11
  return new URL(url);
24✔
12
}
32✔
13

4✔
14
const getRequestParams = (options, body = '', url = false) => {
4✔
15
  if (!options && url) {
16✔
16
    const urlObj = makeUrl(url);
16✔
17
    const query = urlObj.search ? urlObj.search : undefined;
16✔
18
    return {
16✔
19
      host: getHost(urlObj),
16✔
20
      path: urlObj.pathname.split(query)[0],
16✔
21
    };
16✔
22
  }
16✔
UNCOV
23
  return {
×
UNCOV
24
    headers: options.headers,
×
UNCOV
25
    host: getHost(options),
×
UNCOV
26
    path: options.path.split(options.search)[0],
×
UNCOV
27
    method: options.method,
×
UNCOV
28
    payload: body,
×
UNCOV
29
    search: options.search,
×
UNCOV
30
  };
×
31
};
4✔
32

4✔
33
const getProtocol = (options, url = false) => {
4✔
34
  if (!options && url) {
16✔
35
    const { protocol } = makeUrl(url);
16✔
36
    return protocol;
16✔
37
  }
16✔
UNCOV
38
  return options.protocol;
×
39
};
4✔
40

4✔
41
module.exports = {
4✔
42
  getRequestParams,
4✔
43
  getHost,
4✔
44
  getProtocol,
4✔
45
};
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc