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

ringcentral / ringcentral-js / 9887110547

11 Jul 2024 07:13AM UTC coverage: 92.868%. Remained the same
9887110547

push

github

web-flow
Merge pull request #264 from ringcentral/RCLABS-854

Fixed Login Window

580 of 710 branches covered (81.69%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

1920 of 1982 relevant lines covered (96.87%)

41.95 hits per line

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

87.5
/sdk/src/core/Externals.ts
1
const root =
2
    (typeof window !== 'undefined' && window) ||
4!
3
    (typeof global !== 'undefined' && global) ||
4
    (function getRoot() {
5
        return this;
×
6
    })();
7

8
export interface ExternalsOptions {
9
    fetch?: typeof fetch;
10
    Request?: typeof Request;
11
    Response?: typeof Response;
12
    Headers?: typeof Headers;
13
    localStorage?: Storage;
14
}
15

16
export default class Externals implements ExternalsOptions {
4✔
17
    public fetch = root.fetch;
97✔
18

19
    public Request = root.Request;
97✔
20

21
    public Response = root.Response;
97✔
22

23
    public Headers = root.Headers;
97✔
24

25
    public localStorage = root.localStorage;
97✔
26

27
    public constructor({
97!
28
        fetch: fetchImpl,
97✔
29
        Request: RequestImpl,
97✔
30
        Response: ResponseImpl,
97✔
31
        Headers: HeadersImpl,
97✔
32
        localStorage,
97✔
33
    }: ExternalsOptions = {}) {
34
        if (fetchImpl) {this.fetch = fetchImpl;}
97✔
35
        if (RequestImpl) {this.Request = RequestImpl;}
97✔
36
        if (ResponseImpl) {this.Response = ResponseImpl;}
97✔
37
        if (HeadersImpl) {this.Headers = HeadersImpl;}
97✔
38
        if (localStorage) {this.localStorage = localStorage;}
97✔
39

40
        /* istanbul ignore next */
41
        if (!this.fetch || !this.Response || !this.Request || !this.Headers) {
42
            throw new Error('Fetch API is missing');
43
        }
44

45
        /* istanbul ignore next */
46
        if (!this.localStorage) {
47
            throw new Error('LocalStorage is missing');
48
        }
49
    }
50
}
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

© 2025 Coveralls, Inc