@lexho111/plainblog 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Blog.js CHANGED
@@ -387,7 +387,7 @@ export default class Blog {
387
387
  articles: this.articles,
388
388
  };
389
389
  const markdown = formatMarkdown(data);
390
- return markdown;
390
+ console.log(markdown);
391
391
  }
392
392
 
393
393
  /** render this blog content to valid html */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexho111/plainblog",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "A tool for creating and serving a minimalist, single-page blog.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/test/blog.test.js CHANGED
@@ -71,11 +71,12 @@ describe("test blog", () => {
71
71
  const consoleSpy = jest.spyOn(console, "log").mockImplementation(() => {});
72
72
 
73
73
  // Act: Call the method we want to test
74
- await myblog.print();
74
+ myblog.print();
75
+ await new Promise((resolve) => setTimeout(resolve, 100));
75
76
 
76
77
  // Assert: Check if console.log was called with the correct strings
77
78
  expect(consoleSpy).toHaveBeenCalled();
78
- const output = consoleSpy.mock.calls[0][0];
79
+ const output = consoleSpy.mock.calls.map((call) => call[0]).join("\n");
79
80
  expect(output).toContain("# My Test Blog");
80
81
  expect(output).toContain("## Article 1");
81
82
  expect(output).toContain("Content 1");