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

node-opcua / node-opcua / 22636309940

03 Mar 2026 06:03PM UTC coverage: 92.756% (+1.9%) from 90.81%
22636309940

push

github

erossignon
test: disable ENOENT on overlapping trustCertificate invocations in test environments with concurrency tests

18684 of 22141 branches covered (84.39%)

23 of 37 new or added lines in 1 file covered. (62.16%)

5775 existing lines in 228 files now uncovered.

160668 of 173216 relevant lines covered (92.76%)

875869.8 hits per line

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

94.44
/packages/node-opcua-server/source/queue.ts
1
// tslint:disable-next-line:no-var-requires
4✔
2
const Dequeue = require("dequeue");
4✔
3
export class Queue<T> {
852✔
4
    private _d = new Dequeue();
1,144✔
5
    size: number;
1,144✔
6
    constructor() {
1,144✔
7
        this.size = 0;
1,144✔
8
    }
1,144✔
9
    clear(): void {
1,144✔
10
        this.size = 0;
1,228✔
11
    }
1,228✔
12

1,144✔
13
    public first(): T | undefined {
1,144✔
14
        if (this.size === 0) {
33,626!
15
            return undefined;
×
UNCOV
16
        }
×
17
        return this._d.first() as T;
33,626✔
18
    }
33,626✔
19
    public shift(): T | undefined {
1,144✔
20
        if (this.size === 0) {
35,452!
21
            return undefined;
×
UNCOV
22
        }
×
23
        this.size -= 1;
35,452✔
24
        return this._d.shift() as T;
35,452✔
25
    }
35,452✔
26

1,144✔
27
    public push(value: T): void {
1,144✔
28
        this.size += 1;
40,850✔
29
        this._d.push(value);
40,850✔
30
    }
40,850✔
31

1,144✔
32
    public filterOut(predicate: (element: T) => boolean): number {
1,144✔
33
        let counter = 0;
29,620✔
34
        let p = this._d.head.next;
29,620✔
35
        while (p != this._d.head) {
29,620✔
36
            const shouldRemove = predicate(p.data);
28,305,128✔
37
            const pPrev = p;
28,305,128✔
38
            p = p.next;
28,305,128✔
39
            if (shouldRemove) {
28,305,128✔
40
                this.size -= 1;
5,356✔
41
                counter += 1;
5,356✔
42
                pPrev.remove();
5,356✔
43
            }
5,356✔
44
        }
28,305,128✔
45
        return counter;
29,620✔
46
    }
29,620✔
47

1,144✔
48
    public values(): Iterable<T> {
1,144✔
49
        // eslint-disable-next-line @typescript-eslint/no-this-alias
10✔
50
        const self = this;
10✔
51
        const iteratable = {
10✔
52
            [Symbol.iterator]() {
10✔
53
                let cursor = self._d.head;
10✔
54
                const iterator = {
10✔
55
                    next() {
10✔
56
                        cursor = cursor.next;
38✔
57
                        if (cursor === self._d.head) {
38✔
58
                            return { done: true, value: null };
10✔
59
                        }
10✔
60
                        const ret = {
38✔
61
                            done: false,
28✔
62
                            value: cursor.data as T
28✔
63
                        };
28✔
64
                        return ret;
28✔
65
                    }
38✔
66
                };
10✔
67
                return iterator;
10✔
68
            }
10✔
69
        };
10✔
70
        return iteratable as any;
10✔
71
    }
10✔
72
}
1,144✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc