The Real Article
This is the body content that should survive.
It has inline links.
/** * E2E tests for the recipes documented in cookbooks.md. * * Each `describe` block corresponds to one cookbook recipe. The intent is to * exercise the *exact* combination of headers and body fields the cookbook * advertises, so that a future change which silently breaks a recipe is * caught here. * * All tests run against the `html`/`file` input paths so they work offline — * no network or live target site is required. */ import { describe, it } from 'node:test'; import assert from 'node:assert'; import { crawl, crawlWithHeaders, getAgent, getContent, SAMPLE_HTML, } from '../helpers/client'; // --- Recipe 1: RAG inference (defaults) --- describe('cookbook: RAG inference (defaults)', () => { it('default response includes markdown image syntax with URLs', async () => { const res = await crawl({ respondWith: 'markdown' }); assert.strictEqual(res.status, 200); assert.match(res.body.data.content, /!\[.*?\]\(https?:\/\//); }); it('default response keeps markdown link syntax with anchor + href', async () => { const res = await crawl({ respondWith: 'markdown' }); assert.match(res.body.data.content, /\[link to crawling docs\]\(https:\/\/example\.com\/crawling\)/); }); it('default response returns the article body and extracted title', async () => { // The cookbook claims defaults produce "the shape a chat model wants" — // i.e. content + title with the main article surfaced. // Readability extracts the title separately from content, so the
This is the body content that should survive.
It has inline links.
standalone
' }); assert.strictEqual(res.status, 200); assert.ok(res.body.data.content.includes('standalone')); }); });