@@ -47,7 +47,7 @@ class DataAdapter {
4747 }
4848
4949 async writeBinary ( path : string , content : ArrayBuffer , option ?: DataWriteOptions ) : Promise < void > {
50- this . _writeBinary = [ path , content ]
50+ this . _writeBinary = [ path , content ] ;
5151 }
5252
5353 async remove ( path : string ) : Promise < void > {
@@ -158,7 +158,7 @@ export class FileStats {
158158
159159export class TFile {
160160 path = "somefile.md" ;
161- basename : string = "somefile" ;
161+ basename = "somefile" ;
162162 stat : FileStats = new FileStats ( ) ;
163163}
164164
@@ -175,7 +175,14 @@ export class SearchResult {
175175 matches : [ number , number ] [ ] = [ ] ;
176176}
177177
178- export function prepareSimpleSearch (
178+ // Mock configuration that tests can control
179+ // Tests can set this to override the default behavior
180+ export const _prepareSimpleSearchMock = {
181+ behavior : null as ( ( query : string ) => ( text : string ) => null | SearchResult ) | null ,
182+ } ;
183+
184+ // Default implementation (can be overridden by tests)
185+ function defaultPrepareSimpleSearch (
179186 query : string
180187) : ( value : string ) => null | SearchResult {
181188 return ( text : string ) => {
@@ -199,3 +206,12 @@ export function prepareSimpleSearch(
199206 return result ;
200207 } ;
201208}
209+
210+ export function prepareSimpleSearch (
211+ query : string
212+ ) : ( value : string ) => null | SearchResult {
213+ if ( _prepareSimpleSearchMock . behavior ) {
214+ return _prepareSimpleSearchMock . behavior ( query ) ;
215+ }
216+ return defaultPrepareSimpleSearch ( query ) ;
217+ }
0 commit comments