Page MenuHomeSealhub

markdown.test.ts
No OneTemporary

markdown.test.ts

import { Registry } from "../registry";
import { Markdown } from "./markdown";
import { JDDocument, render, simpleJDDContext } from "../index";
import assert from "assert";
import { streamToString } from "tempstream";
describe("markdown component", () => {
it("renders as a part of a JDD", async () => {
const document = [
{ component_name: "markdown", args: { markdown: `# Hello World` } },
{
component_name: "markdown",
args: { markdown: `Multiple components ftw` },
},
] as JDDocument;
const registry = new Registry();
registry.add("markdown", Markdown);
const result = await streamToString(
render(registry, document, simpleJDDContext)
);
assert.strictEqual(
result,
`<h1>Hello World</h1>\n\n<p>Multiple components ftw</p>\n`
);
});
});

File Metadata

Mime Type
text/x-java
Expires
Wed, May 7, 19:37 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625767
Default Alt Text
markdown.test.ts (787 B)

Event Timeline