LCOV - code coverage report
Current view: top level - src/scripts - appRegistry.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 6 6
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { assert } from '@/base/assert'
       2              : import type { ComfyApp } from '@/types/comfy'
       3              : 
       4         2356 : let instance: ComfyApp | undefined
       5              : 
       6              : /**
       7              :  * Called once by `@/scripts/app` after it constructs the singleton. Modules
       8              :  * that the app imports cannot import `@/scripts/app` back without a cycle, so
       9              :  * they reach the instance through `useApp` from `@/scripts/appInstance`.
      10              :  */
      11         2356 : export function registerApp(app: ComfyApp) {
      12         2356 :   instance = app
      13              : }
      14              : 
      15      3034865 : export function useApp(): ComfyApp {
      16      3034865 :   assert(instance, 'ComfyApp accessed before registerApp')
      17      3034865 :   return instance
      18              : }
        

Generated by: LCOV version 2.0-1