/** * /design-html's Pretext embedding recipe, run as written. "### Pretext Source * Embedding" in the generated design-html/SKILL.md tells the agent to copy * design-html/vendor/pretext-embed.html into the page, splice the vendored * bundle in at its PRETEXT_BUNDLE line with a documented awk command, and put * page code at its "// page code" line. The scaffold keeps the bundle in an * inert '); expect(SCAFFOLD).toContain("new Blob([document.getElementById('pretext-src').text], { type: 'text/javascript' })"); expect(SCAFFOLD).toContain('URL.revokeObjectURL(pretextURL)'); expect(SCAFFOLD.indexOf(PAGE_CODE_LINE)).toBeGreaterThan(SCAFFOLD.indexOf('await import(pretextURL)')); expect(SCAFFOLD.lastIndexOf('')).toBeGreaterThan(SCAFFOLD.indexOf(PAGE_CODE_LINE)); for (const name of NAMES) { expect(BUNDLE, name).toMatch(new RegExp(`\\w+ as ${name}\\b`)); expect(SCAFFOLD, name).toMatch(new RegExp(`[{,] ${name}[ ,]`)); } }); test('the vendored bundle can sit in a raw-text