{"record":{"id":"f822f3e0040c41f1","repo":"ruvnet/ruflo","slug":"no-mock-found-for-method-url","errorCode":null,"errorMessage":"No mock found for ${method} ${url}","messagePattern":"No mock found for (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/testing/src/helpers/setup-teardown.ts","lineNumber":466,"sourceCode":"      fetchResponses.push(...responses);\n\n      if (!originalFetch) {\n        originalFetch = global.fetch;\n\n        global.fetch = vi.fn(async (input: string | URL | Request, init?: RequestInit) => {\n          const url = typeof input === 'string' ? input : input.toString();\n          const method = init?.method ?? 'GET';\n\n          const match = fetchResponses.find(r => {\n            const urlMatch = typeof r.url === 'string'\n              ? url.includes(r.url)\n              : r.url.test(url);\n            const methodMatch = !r.method || r.method === method;\n            return urlMatch && methodMatch;\n          });\n\n          if (!match) {\n            throw new Error(`No mock found for ${method} ${url}`);\n          }\n\n          if (match.delay) {\n            await new Promise(resolve => setTimeout(resolve, match.delay));\n          }\n\n          return new Response(JSON.stringify(match.body), {\n            status: match.status ?? 200,\n            headers: match.headers ?? { 'Content-Type': 'application/json' },\n          });\n        });\n      }\n    },\n\n    mockWebSocket(handler: (message: unknown) => unknown): void {\n      // WebSocket mocking would require more setup\n      // This is a placeholder for the interface\n      console.warn('WebSocket mocking not yet implemented');","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/testing/src/helpers/setup-teardown.ts#L448-L484","documentation":"The fetch-mock helper intercepted a request whose method+URL matched none of the registered mock responses (by substring or regex URL and optional method filter). The test helper throws instead of hitting the network, so this means the test forgot to register a mock for that endpoint or the URL/method differs from what was registered.","triggerScenarios":"Thrown at v3/@claude-flow/testing/src/helpers/setup-teardown.ts:466 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register a mock for the method and URL before issuing the request.","Check the request URL and method match the mock definition exactly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}