buncha stuff
This commit is contained in:
parent
1eba3a92b2
commit
e183025a16
12 changed files with 29 additions and 29 deletions
|
|
@ -11,16 +11,16 @@ const mockParseMetadata = (file: string) => {
|
|||
return undefined;
|
||||
};
|
||||
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error Mocked.
|
||||
MarkdownCompiler.prototype["marked"] = mockMarked;
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error Mocked.
|
||||
MarkdownCompiler.prototype["parseMetadata"] = mockParseMetadata;
|
||||
|
||||
test("MarkdownCompiler compiles markdown to HTML", async () => {
|
||||
const plugin = new MarkdownCompiler();
|
||||
const input = "# Hello World";
|
||||
|
||||
const output = await plugin.rewriteFile(input, "test.md");
|
||||
const output = await plugin.rewriteFile(input);
|
||||
expect(typeof output).toBe("string");
|
||||
expect(output).toContain("Hello World");
|
||||
});
|
||||
|
|
@ -28,7 +28,7 @@ test("MarkdownCompiler compiles markdown to HTML", async () => {
|
|||
test("MarkdownCompiler uses metadata title if present", async () => {
|
||||
const plugin = new MarkdownCompiler();
|
||||
const input = "title=Hello\n=+\n# Some Content";
|
||||
const output = await plugin.rewriteFile(input, "test.md");
|
||||
const output = await plugin.rewriteFile(input);
|
||||
expect(output).toContain("Hello");
|
||||
expect(output).toContain("Some Content");
|
||||
});
|
||||
|
|
@ -36,6 +36,6 @@ test("MarkdownCompiler uses metadata title if present", async () => {
|
|||
test("MarkdownCompiler returns HTML for markdown without metadata", async () => {
|
||||
const plugin = new MarkdownCompiler();
|
||||
const input = "# Just Markdown";
|
||||
const output = await plugin.rewriteFile(input, "test.md");
|
||||
const output = await plugin.rewriteFile(input);
|
||||
expect(output).toContain("Just Markdown");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue