MCPcopy Create free account
hub / github.com/Consensys/doc.linea / assertMarkdownResponse

Function assertMarkdownResponse

scripts/agent-docs/verify-preview.js:48–62  ·  view source on GitHub ↗
(label, result)

Source from the content-addressed store, hash-verified

46}
47
48function assertMarkdownResponse(label, result) {
49 assert(result.ok, `${label} returned HTTP ${result.status}`);
50 assert(
51 result.contentType.includes("text/markdown"),
52 `${label} returned ${result.contentType || "no content-type"}`,
53 );
54 assert(
55 !/^\s*<!doctype html/i.test(result.text),
56 `${label} returned HTML instead of Markdown`,
57 );
58 assert(
59 /For the complete Linea documentation index/.test(result.text),
60 `${label} is missing the agent docs directive`,
61 );
62}
63
64function assertExpectedHeaders(label, result, expectedHeaders) {
65 for (const [headerName, expectedValue] of expectedHeaders) {

Callers 1

mainFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected