Skip to content

Commit 088a1a6

Browse files
fix: fix tests
1 parent 47b11eb commit 088a1a6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/RichTextRenderer.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Annotations, RichText } from '@notionhq/client/build/src/api-types';
22

3+
import { RenderingLoggingContext } from './logger';
34
import { RichTextRenderer } from './RichTextRenderer';
45

56
function annotations(x: Partial<Annotations>): Annotations {
@@ -13,6 +14,9 @@ function annotations(x: Partial<Annotations>): Annotations {
1314
...x,
1415
};
1516
}
17+
18+
const context = new RenderingLoggingContext('');
19+
1620
describe("RichTextRenderer", () => {
1721
let sut: RichTextRenderer;
1822
let linkRenderer: typeof jest;
@@ -60,7 +64,7 @@ describe("RichTextRenderer", () => {
6064
},
6165
];
6266

63-
const result = await sut.renderMarkdown(text);
67+
const result = await sut.renderMarkdown(text, context);
6468

6569
expect(result).toEqual("**Hello** World.");
6670
});
@@ -85,7 +89,7 @@ describe("RichTextRenderer", () => {
8589
},
8690
];
8791

88-
const result = await sut.renderMarkdown(text);
92+
const result = await sut.renderMarkdown(text, context);
8993

9094
expect(result).toEqual("Hello **World.**");
9195
});
@@ -110,7 +114,7 @@ describe("RichTextRenderer", () => {
110114
},
111115
];
112116

113-
const result = await sut.renderMarkdown(text);
117+
const result = await sut.renderMarkdown(text, context);
114118

115119
expect(result).toEqual(" ***Hello*** **World.**");
116120
});
@@ -135,7 +139,7 @@ describe("RichTextRenderer", () => {
135139
},
136140
];
137141

138-
const result = await sut.renderMarkdown(text);
142+
const result = await sut.renderMarkdown(text, context);
139143

140144
expect(result).toEqual("**Hello** \n\tWorld\n");
141145
});

0 commit comments

Comments
 (0)