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

help-me-mom / ng-mocks / 487ae8ca-16a6-4bb5-acad-6dc5d9281c32

29 May 2024 08:04AM CUT coverage: 100.0%. Remained the same
487ae8ca-16a6-4bb5-acad-6dc5d9281c32

push

circleci

web-flow
Merge pull request #9064 from help-me-mom/renovate/docs/node-20.14.x

3264 of 3264 branches covered (100.0%)

Branch coverage included in aggregate %.

4823 of 4823 relevant lines covered (100.0%)

8458.47 hits per line

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

100.0
/libs/ng-mocks/src/lib/common/core.def-stack.ts
1
import { mapEntries } from './core.helpers';
1✔
2

3
export default class<K, V> {
1✔
4
  protected stack: Array<Map<K, V>> = [];
3,240✔
5

6
  public constructor() {
7
    this.push();
3,240✔
8
  }
9

10
  public push() {
1✔
11
    this.stack.push(new Map());
18,676✔
12
  }
13

14
  public pop(): Map<V, V> {
1✔
15
    return this.stack.pop() ?? new Map();
15,438✔
16
  }
17

18
  public has(key: K): ReturnType<Map<K, V>['has']> {
1✔
19
    for (let i = this.stack.length - 1; i >= 0; i -= 1) {
130,455✔
20
      if (this.stack[i].has(key)) {
311,168✔
21
        return true;
63,588✔
22
      }
23
    }
24

25
    return false;
66,867✔
26
  }
27

28
  public get(key: K): ReturnType<Map<K, V>['get']> {
1✔
29
    for (let i = this.stack.length - 1; i >= 0; i -= 1) {
64,459✔
30
      if (this.stack[i].has(key)) {
67,154✔
31
        return this.stack[i].get(key);
63,684✔
32
      }
33
    }
34

35
    return undefined;
775✔
36
  }
37

38
  public set(key: K, value: V): this {
1✔
39
    for (let i = this.stack.length - 1; i >= 0; i -= 1) {
86,937✔
40
      this.stack[i].set(key, value);
248,708✔
41
    }
42

43
    return this;
86,937✔
44
  }
45

46
  public merge(resolutions: Map<K, V>): this {
1✔
47
    for (const [key, value] of mapEntries(resolutions)) {
49,210✔
48
      this.set(key, value);
49,210✔
49
    }
50

51
    return this;
2,336✔
52
  }
53
}
1✔
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