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

soajs / soajs / 524

19 Mar 2025 03:17PM UTC coverage: 70.117% (-3.4%) from 73.527%
524

push

travis-ci

antoinehage
Merge branch 'develop'

610 of 1096 branches covered (55.66%)

1077 of 1536 relevant lines covered (70.12%)

5.92 hits per line

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

81.25
/modules/registry/api.js
1
"use strict";
2

3
/**
4
 * @license
5
 * Copyright SOAJS All Rights Reserved.
6
 *
7
 * Use of this source code is governed by an Apache license that can be
8
 * found in the LICENSE file at the root of this repository
9
 */
10

11
const { httpRequestLight } = require("../../utilities/request.js");
12

1✔
13
if (!process.env.SOAJS_REGISTRY_API || process.env.SOAJS_REGISTRY_API.indexOf(":") === -1) {
14
        throw new Error('Invalid format for SOAJS_REGISTRY_API [hostname:port]: ' + process.env.SOAJS_REGISTRY_API);
1!
15
} else {
×
16
        let portFromEnv = process.env.SOAJS_REGISTRY_API.substring(process.env.SOAJS_REGISTRY_API.indexOf(":") + 1);
17
        let port = parseInt(portFromEnv);
1✔
18
        if (isNaN(port)) {
1✔
19
                throw new Error('port must be integer: [' + portFromEnv + ']');
1!
20
        }
×
21
}
22

23
let model = {
24
        "fetchRegistry": function (param, options, cb) {
1✔
25
                let reg = null;
26

3✔
27
                let requestOption = {
28
                        "uri": "http://" + process.env.SOAJS_REGISTRY_API + "/getRegistry?env=" + options.envCode + "&name=" + param.name + "&type=" + param.type + "&setBy=" + options.setBy,
3✔
29
                        "json": true
30
                };
31
                httpRequestLight(requestOption)
32
                        .then((body) => {
3✔
33
                                if (body && body.result) {
34
                                        reg = body.data;
3!
35
                                }
3✔
36
                                return cb(null, reg);
37
                        })
3✔
38
                        .catch((error) => {
39
                                return cb(error, reg);
40
                        });
×
41

42
                // request(requestOption, function (error, response, body) {
43
                //         if (!error) {
44
                //                 if (body && body.result) {
45
                //                         reg = body.data;
46
                //                 }
47
                //         }
48
                //         return cb(error, reg);
49
                // });
50
        }
51
};
52

53
module.exports = model;
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