Skip to content

Build your personal knowledge base with Trilium Notes

chore(test): add test for markdown import

Elian Doran36387deb0dfb
diff --git a/src/services/import/markdown.spec.ts b/src/services/import/markdown.spec.ts
new file mode 100644
index 0000000000..a09592210c
--- /dev/null
+++ b/src/services/import/markdown.spec.ts
@@ -0,0 +1,19 @@
+import { trimIndentation } from "../../../spec/support/utils.js";
+import markdownService from "./markdown.js";
+
+describe("markdown", () => {
+ it("converts h1 heading", () => {
+ const result = markdownService.renderToHtml(trimIndentation`\
+ # Hello
+ ## world
+ # another one
+ Hello, world
+ `, "title");
+ expect(result).toBe(trimIndentation`\
+ <h2>Hello</h2>
+ <h2>world</h2>
+ <h2>another one</h2>
+ <p>Hello, world</p>
+ `);
+ });
+});