@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 +1 -1
- package/package.json +1 -1
- package/test/blog.test.js +3 -2
package/Blog.js
CHANGED
package/package.json
CHANGED
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
|
-
|
|
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]
|
|
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");
|