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

rokucommunity / brighterscript / #12196

17 Apr 2024 07:54PM UTC coverage: 87.919% (-0.6%) from 88.473%
#12196

push

web-flow
Upgrade to @rokucommunity/logger (#1137)

* Upgrade to @rokucommunity/logger

* Add original logger class back

* @rokucommunity/logger v0.3.4

6020 of 7320 branches covered (82.24%)

Branch coverage included in aggregate %.

29 of 29 new or added lines in 10 files covered. (100.0%)

54 existing lines in 1 file now uncovered.

8775 of 9508 relevant lines covered (92.29%)

1742.83 hits per line

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

52.0
/src/deferred.ts
1
export class Deferred<T = void, TReject = any> {
1✔
2
    constructor() {
3
        this._promise = new Promise<T>((resolve, reject) => {
154✔
4
            this._resolve = resolve;
154✔
5
            this._reject = reject;
154✔
6
        });
7
    }
8
    public get promise() {
9
        return this._promise;
154✔
10
    }
11
    private _promise: Promise<T>;
12

13
    /**
14
     * Indicates whether the promise has been resolved or rejected
15
     */
16
    public get isCompleted() {
17
        return this._isCompleted;
×
18
    }
19
    private _isCompleted = false;
154✔
20

21
    /**
22
     * Indicates whether the promise has been resolved
23
     */
24
    public get isResolved() {
25
        return this._isResolved;
×
26
    }
27
    private _isResolved = false;
154✔
28

29
    /**
30
     * Indicates whether the promise has been rejected
31
     */
32
    public get isRejected() {
33
        return this._isRejected;
×
34
    }
35
    private _isRejected = false;
154✔
36

37
    /**
38
     * Resolve the promise
39
     */
40
    public resolve(value?: T) {
41
        if (this._isCompleted) {
154!
42
            throw new Error('Already completed.');
×
43
        }
44
        this._isCompleted = true;
154✔
45
        this._isResolved = true;
154✔
46
        this._resolve(value);
154✔
47
    }
48
    private _resolve: (value: T) => void;
49

50
    /**
51
     * Reject the promise
52
     */
53
    public reject(value: TReject) {
54
        if (this._isCompleted) {
×
55
            throw new Error('Already completed.');
×
56
        }
57
        this._isCompleted = true;
×
58
        this._isRejected = true;
×
59
        this._reject(value);
×
60
    }
61
    private _reject: (value: TReject) => void;
62
}
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