1
1
import * as fs from 'fs'
2
2
3
+ import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
4
+
3
5
import { 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'
7
7
import { normalizeI18nKey } from '../src/utils/formatUtil'
8
8
9
9
const localePath = './src/locales/en/main.json'
@@ -26,18 +26,23 @@ test('collect-i18n-node-defs', async ({ comfyPage }) => {
26
26
} )
27
27
} )
28
28
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
+ }
37
45
)
38
- // Ignore DevTools nodes (used for internal testing)
39
- . filter ( ( def ) => ! def . name . startsWith ( 'DevTools' ) )
40
- . map ( ( def ) => new ComfyNodeDefImpl ( def ) )
41
46
42
47
console . log ( `Collected ${ nodeDefs . length } node definitions` )
43
48
0 commit comments