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

pmcelhaney / counterfact / 5942933897

22 Aug 2023 06:59PM UTC coverage: 83.567% (-3.8%) from 87.388%
5942933897

push

github

web-flow
Merge pull request #517 from pmcelhaney/windows-support

disable the end-to-end test because it won't work on Windows

389 of 423 branches covered (91.96%)

Branch coverage included in aggregate %.

1818 of 2218 relevant lines covered (81.97%)

9.64 hits per line

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

95.89
/src/typescript-generator/coder.js
1
export class Coder {
1✔
2
  constructor(requirement) {
1✔
3
    this.requirement = requirement;
174✔
4
  }
174✔
5

1✔
6
  get id() {
1✔
7
    if (this.requirement.isReference) {
46!
8
      return `${this.constructor.name}@${this.requirement.$ref}`;
×
9
    }
×
10

46✔
11
    return `${this.constructor.name}@${this.requirement.url}`;
46✔
12
  }
46✔
13

1✔
14
  beforeExport() {
1✔
15
    return "";
15✔
16
  }
15✔
17

1✔
18
  write() {
1✔
19
    // This method should be overridden by a subclass.
8✔
20

8✔
21
    return `/* ${this.id} */`;
8✔
22
  }
8✔
23

1✔
24
  async delegate() {
1✔
25
    if (!this.requirement.isReference) {
18✔
26
      return this;
17✔
27
    }
17✔
28

1✔
29
    const requirement = await this.requirement.reference();
1✔
30

1✔
31
    return new this.constructor(requirement);
1✔
32
  }
1✔
33

1✔
34
  *names(rawName = this.requirement.url.split("/").at(-1)) {
1✔
35
    const name = rawName
17✔
36
      .replace(/^\d/u, (digit) => `_${digit}`)
17✔
37
      .replaceAll(/[^\w$]/gu, "_");
17✔
38

17✔
39
    yield name;
17✔
40

13✔
41
    let index = 1;
13✔
42

13✔
43
    const MAX_NAMES_TO_GENERATE_BEFORE_GIVING_UP = 100;
13✔
44

13✔
45
    while (index < MAX_NAMES_TO_GENERATE_BEFORE_GIVING_UP) {
17✔
46
      index += 1;
23✔
47
      yield name + index;
23✔
48
    }
10✔
49
  }
17✔
50

1✔
51
  typeDeclaration() {
1✔
52
    return "";
18✔
53
  }
18✔
54

1✔
55
  modulePath() {
1✔
56
    return "did-not-override-coder-modulePath.ts";
6✔
57
  }
6✔
58
}
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