Files
openworker/docs-site/scripts/render-guide.test.mjs
T
Rohit PrasadandDevika Verma d53e058eda Introduce OpenWorker Harness SDK (in beta), agent service cluster and relevant developer documentation (#844)
Allow developers to easily build AI apps without worrying about the harness part.
Bundles the Rust agent runtime as a SDK (Rust and TypeScript) for building desktop and web applications. Applications can manage a local harness or connect to an authenticated harness service on k8s with separately scaled workers and sandbox execution.

The implementation is primarily contained in harness/, with deployment tooling in deploy/, Markdown guides in docs/harness/guides/, and the static documentation site in docs-site/. It does not replace the existing Python harness or migrate OpenWorker Desktop.

Co-authored-by: Devika Verma <devikaverma11@gmail.com>
2026-11-06 09:45:20 -08:00

18 lines
1.1 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import {renderGuide} from '../src/lib/render-guide.mjs';
const wrap=body=>'---\ntitle: "Guide"\n---\n\n'+body;
test('promotes introductory sentence without losing remaining prose or code',async()=>{
const result=await renderGuide(wrap('First sentence. Second sentence.\n\n## Work\n\n```ts\nconst value = 42;\n```'));
assert.match(result.subtitle,/First sentence\./);
assert.match(result.html,/Second sentence\./);
assert.equal(result.headings[0].slug,'work');
assert.match(result.html.replace(/<[^>]*>/g,''),/const value = 42;/);
});
test('table-first and single-paragraph guides preserve all content',async()=>{
const table=await renderGuide(wrap('| Symptom | Check |\n|---|---|\n| Missing runtime | Set a path |'));
assert.equal(table.subtitle,'');assert.match(table.html,/<table>/);assert.match(table.html,/Missing runtime/);
const single=await renderGuide(wrap('Use version `0.1.0-beta.1`. Keep the helper matched.'));
assert.match(single.subtitle,/0\.1\.0-beta\.1/);assert.match(single.html,/Keep the helper matched/);
});