diff --git a/test/__snapshots__/frontmatter-markdown-loader.test.js.snap b/test/__snapshots__/frontmatter-markdown-loader.test.js.snap index e61d17c..b410208 100644 --- a/test/__snapshots__/frontmatter-markdown-loader.test.js.snap +++ b/test/__snapshots__/frontmatter-markdown-loader.test.js.snap @@ -14,6 +14,13 @@ exports[`frontmatter-markdown-loader react mode returns renderable React compone FRIEND CHEERS
+
+
+ const multipleLine = true; console.warn(multipleLine)
+
+
`;
@@ -58,5 +65,12 @@ exports[`frontmatter-markdown-loader react mode returns renderable React compone
FRIEND CHEERS
+
+
+ const multipleLine = true; console.warn(multipleLine)
+
+
`;
diff --git a/test/frontmatter-markdown-loader.test.js b/test/frontmatter-markdown-loader.test.js
index 5b76ba8..2d096de 100644
--- a/test/frontmatter-markdown-loader.test.js
+++ b/test/frontmatter-markdown-loader.test.js
@@ -39,7 +39,9 @@ describe("frontmatter-markdown-loader", () => {
});
it("returns compiled HTML for 'html' property", () => {
- expect(loaded.html).toBe("GOOD BYE
FRIEND\nCHEERS
GOOD BYE
FRIEND\nCHEERS
const multipleLine = true;\nconsole.warn(multipleLine)\n
\n"
+ );
});
it("returns frontmatter object for 'attributes' property", () => {
@@ -82,7 +84,9 @@ describe("frontmatter-markdown-loader", () => {
describe("markdownId option", () => {
it("returns HTML with configured markdownIt: breaks option is enabled as configuration", () => {
load(markdownWithFrontmatter, { ...defaultContext, query: { markdownIt: { breaks: true } } });
- expect(loaded.html).toBe("GOOD BYE
FRIEND
\nCHEERS
GOOD BYE
FRIEND
\nCHEERS
const multipleLine = true;\nconsole.warn(multipleLine)\n
\n"
+ )
});
it("returns HTML with configured markdownIt instance: breaks option is enabled by .enable", () => {
@@ -96,14 +100,18 @@ describe("frontmatter-markdown-loader", () => {
};
load(markdownWithFrontmatter, { ...defaultContext, query: { markdownIt: markdownItInstance } });
- expect(loaded.html).toBe("GOOD BYE
FRIEND\nCHEERS
GOOD BYE
FRIEND\nCHEERS
const multipleLine = true;\nconsole.warn(multipleLine)\n
\n"
+ );
});
});
describe("body mode is enabled", () => {
it("returns raw markdown body for 'body' property", () => {
load(markdownWithFrontmatter, { ...defaultContext, query: { mode: [Mode.BODY] } });
- expect(loaded.body).toBe("# Title\n\nGOOD `BYE` FRIEND\nCHEERS\n");
+ expect(loaded.body).toBe(
+ "# Title\n\nGOOD `BYE` FRIEND\nCHEERS\n\n```js\nconst multipleLine = true;\nconsole.warn(multipleLine)\n```\n"
+ );
});
});
diff --git a/test/with-frontmatter.md b/test/with-frontmatter.md
index a596b06..5bf5d8a 100644
--- a/test/with-frontmatter.md
+++ b/test/with-frontmatter.md
@@ -8,3 +8,8 @@ tags:
GOOD `BYE` FRIEND
CHEERS
+
+```js
+const multipleLine = true;
+console.warn(multipleLine)
+```