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

pmcelhaney / counterfact / 3919348865

pending completion
3919348865

push

github

GitHub
Update dependency eslint-config-hardcore to v26

398 of 420 branches covered (94.76%)

Branch coverage included in aggregate %.

1802 of 2023 relevant lines covered (89.08%)

22.18 hits per line

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

87.5
/src/server/context-registry.js
1
export function parentPath(path) {
1✔
2
  return String(path.split("/").slice(0, -1).join("/")) || "/";
46✔
3
}
46✔
4

1✔
5
export class ContextRegistry {
1✔
6
  entries = new Map();
1✔
7

1✔
8
  constructor() {
1✔
9
    this.add("/", {});
30✔
10
  }
30✔
11

1✔
12
  add(path, context) {
1✔
13
    if (context === undefined) {
38!
14
      throw new Error("context cannot be undefined");
×
15
    }
×
16

38✔
17
    this.entries.set(path, context);
38✔
18
  }
38✔
19

1✔
20
  find(path) {
1✔
21
    return this.entries.get(path) ?? this.find(parentPath(path));
78✔
22
  }
78✔
23

1✔
24
  update(path, updatedContext) {
1✔
25
    const context = this.find(path);
1✔
26

1✔
27
    for (const property in updatedContext) {
1✔
28
      if (
1✔
29
        Object.prototype.hasOwnProperty.call(updatedContext, property) &&
1✔
30
        !Object.prototype.hasOwnProperty.call(context, property)
1✔
31
      ) {
1!
32
        context[property] = updatedContext[property];
×
33
      }
×
34
    }
1✔
35

1✔
36
    Object.setPrototypeOf(context, Object.getPrototypeOf(updatedContext));
1✔
37
  }
1✔
38
}
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

© 2026 Coveralls, Inc