This is a test paragraph
-This is a second test paragraph. This is a second sentence.
-This is a another test paragraph. This is a another sentence.
-this is a codeblock
This is a new paragraph.
@@ -17,14 +11,14 @@ exports[`should diff a complex document 1`] = `This is a placeholder
this is a highlight
This is a test paragraph
This is a second test paragraph. This is a second sentence.
This is a another test paragraph. This is a another sentence.
this is a codeblock
-This is an info block
This is a placeholder
this is a highlight
same on both sides
same on both sides
same on both sides
" +This is an info block
This is a placeholder
this is a highlight
same on both sides
same on both sides
same on both sides
" `; diff --git a/server/utils/markdownDiff.test.js b/server/utils/markdownDiff.test.js index 0718db28d1..5f2f1338a9 100644 --- a/server/utils/markdownDiff.test.js +++ b/server/utils/markdownDiff.test.js @@ -5,12 +5,18 @@ import markdownDiff from "./markdownDiff"; it("should diff a complex document", async () => { const before = await fs.promises.readFile( - path.resolve(__dirname, "..", "test", "fixtures", "complex.md"), + path.resolve(process.cwd(), "server", "test", "fixtures", "complex.md"), "utf8" ); const after = await fs.promises.readFile( - path.resolve(__dirname, "..", "test", "fixtures", "complexModified.md"), + path.resolve( + process.cwd(), + "server", + "test", + "fixtures", + "complexModified.md" + ), "utf8" ); @@ -25,7 +31,7 @@ it("should return empty string when both sides are empty", () => { it("should return everything inserted when previously empty", async () => { const content = await fs.promises.readFile( - path.resolve(__dirname, "..", "test", "fixtures", "complex.md"), + path.resolve(process.cwd(), "server", "test", "fixtures", "complex.md"), "utf8" );