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

realm / realm-js / 6379399597

02 Oct 2023 11:17AM CUT coverage: 85.388%. Remained the same
6379399597

Pull #6169

github

web-flow
Delete deploy-cluster workflow

This workflow keeps a cluster on QA alive for v11 to test against - which is no longer needed are we're focussing work on v12 going forward.
Pull Request #6169: Delete deploy-cluster workflow

894 of 1109 branches covered (0.0%)

Branch coverage included in aggregate %.

2326 of 2662 relevant lines covered (87.38%)

969.9 hits per line

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

26.32
/packages/realm/src/platform/node/sync-proxy-config.ts
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright 2023 Realm Inc.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
//
17
////////////////////////////////////////////////////////////////////////////
18

19
import process from "node:process";
20
import { URL } from "node:url";
21

22
import { ProxyType } from "realm/binding";
23
import { inject } from "../sync-proxy-config";
24

25
inject({
1✔
26
  create() {
27
    for (const envVar of ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"]) {
1,520✔
28
      const proxyUrlAsString = process.env[envVar];
6,080✔
29
      if (proxyUrlAsString) {
6,080!
30
        let type: ProxyType;
31
        const proxyUrl = new URL(proxyUrlAsString);
×
32
        const protocol = proxyUrl.protocol;
×
33
        if (protocol === "http:") {
×
34
          type = ProxyType.Http;
×
35
        } else if (protocol === "https:") {
×
36
          type = ProxyType.Https;
×
37
        } else {
38
          throw new Error(`Expected either 'http' or 'https' as protocol for ${envVar} (got ${protocol})`);
×
39
        }
40

41
        const config = {
×
42
          address: proxyUrl.hostname,
43
          type,
44
          port: parseInt(proxyUrl.port, 10),
45
        };
46
        return config;
×
47
      }
48
    }
49

50
    // no environment variable found, and we skip the proxy configuration
51
    return undefined;
1,520✔
52
  },
53
});
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

© 2025 Coveralls, Inc