11import  *  as  fs  from  'fs' 
22
3+ import  type  {  ComfyNodeDef  }  from  '@/schemas/nodeDefSchema' 
4+ 
35import  {  comfyPageFixture  as  test  }  from  '../browser_tests/fixtures/ComfyPage' 
4- import  type  {  ComfyNodeDef  }  from  '../src/schemas/nodeDefSchema' 
5- import  type  {  ComfyApi  }  from  '../src/scripts/api' 
6- import  {  ComfyNodeDefImpl  }  from  '../src/stores/nodeDefStore' 
6+ import  type  {  ComfyNodeDefImpl  }  from  '../src/stores/nodeDefStore' 
77import  {  normalizeI18nKey  }  from  '../src/utils/formatUtil' 
88
99const  localePath  =  './src/locales/en/main.json' 
@@ -26,18 +26,23 @@ test('collect-i18n-node-defs', async ({ comfyPage }) => {
2626    } ) 
2727  } ) 
2828
29-   const  nodeDefs : ComfyNodeDefImpl [ ]  =  ( 
30-     Object . values ( 
31-       await  comfyPage . page . evaluate ( async  ( )  =>  { 
32-         // @ts -expect-error - app is dynamically added to window 
33-         const  api  =  window [ 'app' ] . api  as  ComfyApi 
34-         return  await  api . getNodeDefs ( ) 
35-       } ) 
36-     )  as  ComfyNodeDef [ ] 
29+   // Note: Don't mock the object_info API endpoint - let it hit the actual backend 
30+ 
31+   const  nodeDefs : ComfyNodeDefImpl [ ]  =  await  comfyPage . page . evaluate ( 
32+     async  ( )  =>  { 
33+       // @ts -expect-error - app is dynamically added to window 
34+       const  api  =  window [ 'app' ] . api 
35+       const  rawNodeDefs  =  await  api . getNodeDefs ( ) 
36+       const  {  ComfyNodeDefImpl }  =  await  import ( '../src/stores/nodeDefStore' ) 
37+ 
38+       return  ( 
39+         Object . values ( rawNodeDefs ) 
40+           // Ignore DevTools nodes (used for internal testing) 
41+           . filter ( ( def : ComfyNodeDef )  =>  ! def . name . startsWith ( 'DevTools' ) ) 
42+           . map ( ( def : ComfyNodeDef )  =>  new  ComfyNodeDefImpl ( def ) ) 
43+       ) 
44+     } 
3745  ) 
38-     // Ignore DevTools nodes (used for internal testing) 
39-     . filter ( ( def )  =>  ! def . name . startsWith ( 'DevTools' ) ) 
40-     . map ( ( def )  =>  new  ComfyNodeDefImpl ( def ) ) 
4146
4247  console . log ( `Collected ${ nodeDefs . length }  ) 
4348
0 commit comments