@@ -1059,12 +1059,16 @@ describe('server-v2 /api/v1 prompts', () => {
10591059 it ( 'keeps the supplied name in the notice when unsupported-image persistence fails' , async ( ) => {
10601060 const cacheDir = await mkdtemp ( join ( tmpdir ( ) , 'pythinker-prompt-media-' ) ) ;
10611061 try {
1062- const store = {
1063- save : vi . fn ( async ( ) => {
1064- throw new Error ( 'disk full' ) ;
1062+ const save = vi . fn ( async ( ) => {
1063+ throw new Error ( 'disk full' ) ;
1064+ } ) ;
1065+ const store : IFileService = {
1066+ _serviceBrand : undefined ,
1067+ save,
1068+ get : vi . fn ( async ( ) => {
1069+ throw new Error ( 'unexpected get' ) ;
10651070 } ) ,
10661071 delete : vi . fn ( async ( ) => undefined ) ,
1067- get : vi . fn ( ) ,
10681072 } ;
10691073 const prepared = await resolvePromptMediaFiles (
10701074 [
@@ -1078,7 +1082,7 @@ describe('server-v2 /api/v1 prompts', () => {
10781082 } ,
10791083 } ,
10801084 ] ,
1081- store as unknown as IFileService ,
1085+ store ,
10821086 cacheDir ,
10831087 ) ;
10841088 expect ( prepared . content ) . toHaveLength ( 1 ) ;
@@ -1087,7 +1091,7 @@ describe('server-v2 /api/v1 prompts', () => {
10871091 expect ( notice . text ) . toContain ( '[Image omitted' ) ;
10881092 expect ( notice . text ) . toContain ( '"scan.avif"' ) ;
10891093 expect ( notice . text ) . toContain ( 'image/avif' ) ;
1090- expect ( store . save ) . toHaveBeenCalledOnce ( ) ;
1094+ expect ( save ) . toHaveBeenCalledOnce ( ) ;
10911095 } finally {
10921096 await rm ( cacheDir , { recursive : true , force : true } ) ;
10931097 }
0 commit comments