Page MenuHomeSealhub

markdown.test.ts
No OneTemporary

markdown.test.ts

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

File Metadata

Mime Type
text/x-java
Expires
Tue, Jul 8, 08:42 (2 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
810177
Default Alt Text
markdown.test.ts (955 B)

Event Timeline