MCPcopy Create free account
hub / github.com/CopilotKit/aimock / getTestId

Function getTestId

src/helpers.ts:1263–1280  ·  view source on GitHub ↗
(req: http.IncomingMessage)

Source from the content-addressed store, hash-verified

1261}
1262
1263export function getTestId(req: http.IncomingMessage): string {
1264 const headerValue = req.headers["x-test-id"];
1265 if (Array.isArray(headerValue)) {
1266 if (headerValue.length > 0 && headerValue[0]) return headerValue[0];
1267 } else if (typeof headerValue === "string" && headerValue) {
1268 return headerValue;
1269 }
1270
1271 const url = req.url ?? "/";
1272 const qIdx = url.indexOf("?");
1273 if (qIdx !== -1) {
1274 const params = new URLSearchParams(url.slice(qIdx + 1));
1275 const queryValue = params.get("testId");
1276 if (queryValue) return queryValue;
1277 }
1278
1279 return DEFAULT_TEST_ID;
1280}
1281
1282export function getContext(req: http.IncomingMessage): string | undefined {
1283 const headerValue = req.headers["x-aimock-context"];

Callers 15

handleVideoCreateFunction · 0.85
handleVideoStatusFunction · 0.85
handleOllamaFunction · 0.85
handleOllamaGenerateFunction · 0.85
handleOllamaEmbeddingsFunction · 0.85
handleConverseFunction · 0.85
handleConverseStreamFunction · 0.85
handleCohereFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…