MCPcopy Create free account
hub / github.com/google/pprof / TestFixture

Class TestFixture

browsertests/testdata/testfixture.js:4–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2// be returned to Go code. Each element in the result array is either
3// an array of the form ["LOG", ...], or ["ERROR", ...].
4class TestFixture {
5 constructor() {
6 this.context = ""; // Added to front of all log and error messages.
7 this.result = [];
8 }
9
10 run(name, subtest) {
11 this.result.push(["LOG", "===", name]);
12 this.context = "";
13 subtest();
14 this.context = "";
15 }
16
17 // setContext arranges to add name(args) to all messages added
18 // until the next setContext or run call.
19 setContext(name, ...args) {
20 this.context = name + "(" + args.join(",") + ")";
21 }
22
23 log(...args) {
24 this.result.push(["LOG", this.context, ...args]);
25 }
26
27 err(...args) {
28 this.result.push(["ERROR", this.context, ...args]);
29 }
30}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…