11import { Annotations , RichText } from '@notionhq/client/build/src/api-types' ;
22
3+ import { RenderingLoggingContext } from './logger' ;
34import { RichTextRenderer } from './RichTextRenderer' ;
45
56function 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+
1620describe ( "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