@@ -5,6 +5,12 @@ import path from 'path';
55import { CodebaseIndexer } from '../src/core/indexer.js' ;
66import { rmWithRetries } from './test-helpers.js' ;
77
8+ vi . mock ( '../src/core/reranker.js' , ( ) => ( {
9+ rerank : vi . fn ( async ( _query : string , results : unknown ) => results ) ,
10+ getRerankerStatus : vi . fn ( ( ) => 'fallback' ) ,
11+ isAmbiguous : vi . fn ( ( ) => false )
12+ } ) ) ;
13+
814type ToolCallRequest = {
915 jsonrpc : '2.0' ;
1016 id : number ;
@@ -201,7 +207,7 @@ export class ProfileService {
201207 }
202208 expect ( preflight . ready ) . toBeDefined ( ) ;
203209 expect ( typeof preflight . ready ) . toBe ( 'boolean' ) ;
204- } ) ;
210+ } , 30000 ) ;
205211
206212 it ( 'decision card has all expected fields when returned' , async ( ) => {
207213 if ( ! tempRoot ) throw new Error ( 'tempRoot not initialized' ) ;
@@ -253,7 +259,7 @@ export class ProfileService {
253259 if ( preflight . whatWouldHelp ) {
254260 expect ( Array . isArray ( preflight . whatWouldHelp ) ) . toBe ( true ) ;
255261 }
256- } ) ;
262+ } , 30000 ) ;
257263
258264 it ( 'intent="explore" returns lightweight preflight' , async ( ) => {
259265 if ( ! tempRoot ) throw new Error ( 'tempRoot not initialized' ) ;
@@ -284,7 +290,7 @@ export class ProfileService {
284290 expect ( typeof preflight . ready ) . toBe ( 'boolean' ) ;
285291 // Should NOT have full decision card fields for explore
286292 }
287- } ) ;
293+ } , 30000 ) ;
288294
289295 it ( 'includes snippet field when includeSnippets=true' , async ( ) => {
290296 if ( ! tempRoot ) throw new Error ( 'tempRoot not initialized' ) ;
@@ -315,7 +321,7 @@ export class ProfileService {
315321 // At least some results should have a snippet
316322 const withSnippets = parsed . results . filter ( ( result ) => result . snippet ) ;
317323 expect ( withSnippets . length ) . toBeGreaterThan ( 0 ) ;
318- } ) ;
324+ } , 30000 ) ;
319325
320326 it ( 'does not include snippet field when includeSnippets=false' , async ( ) => {
321327 if ( ! tempRoot ) throw new Error ( 'tempRoot not initialized' ) ;
@@ -344,7 +350,7 @@ export class ProfileService {
344350 parsed . results . forEach ( ( result ) => {
345351 expect ( result . snippet ) . toBeUndefined ( ) ;
346352 } ) ;
347- } ) ;
353+ } , 30000 ) ;
348354
349355 it ( 'scope header starts snippet when includeSnippets=true' , async ( ) => {
350356 if ( ! tempRoot ) throw new Error ( 'tempRoot not initialized' ) ;
@@ -375,5 +381,5 @@ export class ProfileService {
375381 const firstLine = withSnippet . snippet . split ( '\n' ) [ 0 ] . trim ( ) ;
376382 expect ( firstLine ) . toMatch ( / ^ \/ \/ / ) ;
377383 }
378- } ) ;
384+ } , 30000 ) ;
379385} ) ;
0 commit comments