MCPcopy Index your code
hub / github.com/buildbot/buildbot / when

Method when

www/data-module/src/data/MockDataClient.ts:27–36  ·  view source on GitHub ↗
(endpoint: string, query: Query, returnValue: any)

Source from the content-addressed store, hash-verified

25 private expects: {endpoint: string, query: Query}[] = [];
26
27 when(endpoint: string, query: Query, returnValue: any) {
28 for (const mock of this.mocks) {
29 if (mock.endpoint === endpoint && mock.query === query) {
30 mock.returnValue = returnValue;
31 return;
32 }
33 }
34
35 this.mocks.push({endpoint: endpoint, query: query, returnValue: returnValue});
36 }
37
38 expect(endpoint: string, query: Query, returnValue: any) {
39 this.expects.push({endpoint: endpoint, query: query});

Callers 2

expectMethod · 0.95
DataClient.test.tsFile · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected