MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / makeStubBackend

Function makeStubBackend

test/web-search.test.ts:112–121  ·  view source on GitHub ↗
(name: string, responses: { results?: any[]; error?: Error })

Source from the content-addressed store, hash-verified

110
111describe('WebSearchTool with injected backend', () => {
112 function makeStubBackend(name: string, responses: { results?: any[]; error?: Error }): WebSearchBackend {
113 return {
114 name,
115 requiresAuth: false,
116 async search(_q, _o) {
117 if (responses.error) throw responses.error;
118 return responses.results ?? [];
119 },
120 };
121 }
122
123 it('formats successful results with a numbered listing', async () => {
124 const tool = new WebSearchTool();

Callers 1

web-search.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected