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

pmcelhaney / counterfact / 7667970487

26 Jan 2024 12:21PM CUT coverage: 86.212%. Remained the same
7667970487

push

github

web-flow
Merge pull request #736 from pmcelhaney/changeset-release/main

884 of 973 branches covered (0.0%)

Branch coverage included in aggregate %.

2780 of 3277 relevant lines covered (84.83%)

41.54 hits per line

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

82.14
/src/typescript-generator/context-coder.js
1
import nodePath from "node:path";
2✔
2

2✔
3
import { Coder } from "./coder.js";
2✔
4

2✔
5
export class ContextCoder extends Coder {
2✔
6
  pathString() {
2✔
7
    return this.requirement.url
×
8
      .split("/")
×
9
      .at(-2)
×
10
      .replaceAll("~1", "/")
×
11
      .replaceAll("~0", "~");
×
12
  }
×
13

2✔
14
  get id() {
2✔
15
    return "ContextCoder";
2✔
16
  }
2✔
17

2✔
18
  names() {
2✔
19
    return super.names("Context");
2✔
20
  }
2✔
21

2✔
22
  beforeExport(path) {
2✔
23
    return `/**
2✔
24
* This is the default context for Counterfact.
2✔
25
* Change the code to suit your needs.
2✔
26
*/
2✔
27
class Context {
2✔
28
  // delete this line to make the class type safe
2✔
29
  [key: string]: any; 
2✔
30

2✔
31
  // A helper when you accessing the context object via the REPL. You can delete it if you like.
2✔
32
  [Symbol.for('nodejs.util.inspect.custom')](depth, options, inspect) {
2✔
33
    return inspect(this, { ...options, customInspect: false }) + "\\n\\n ^ This is the default context object. You can edit its definition at ${path}";
2✔
34
  }
2✔
35
}
2✔
36
`;
2✔
37
  }
2✔
38

2✔
39
  write() {
2✔
40
    return "new Context()";
2✔
41
  }
2✔
42

2✔
43
  modulePath() {
2✔
44
    return nodePath
×
45
      .join("paths", nodePath.dirname(this.pathString()), "$.context.ts")
×
46
      .replaceAll("\\", "/");
×
47
  }
×
48
}
2✔
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