mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 10:12:11 +00:00
feat: enforce no-explicit-any in browser tests via oxlint
- Add typescript/no-explicit-any override for browser_tests/**/*.ts - Fix 9 violations with proper types instead of any - Add TestGraphAccess interface for typed node access - Add function overloads to getExportedWorkflow for proper return types - Fix floating promise in colorPalette.spec.ts Amp-Thread-ID: https://ampcode.com/threads/T-019c1854-3c3c-723d-8ce6-183ce06fcf1b Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { readFileSync } from 'fs'
|
||||
|
||||
import type {
|
||||
ComfyApiWorkflow,
|
||||
ComfyWorkflowJSON
|
||||
} from '../../../src/platform/workflow/validation/schemas/workflowSchema'
|
||||
import type { WorkspaceStore } from '../../types/globals'
|
||||
import type { ComfyPage } from '../ComfyPage'
|
||||
|
||||
@@ -107,7 +111,13 @@ export class WorkflowHelper {
|
||||
})
|
||||
}
|
||||
|
||||
async getExportedWorkflow(options?: { api?: boolean }): Promise<any> {
|
||||
async getExportedWorkflow(options: { api: true }): Promise<ComfyApiWorkflow>
|
||||
async getExportedWorkflow(options?: {
|
||||
api?: false
|
||||
}): Promise<ComfyWorkflowJSON>
|
||||
async getExportedWorkflow(options?: {
|
||||
api?: boolean
|
||||
}): Promise<ComfyWorkflowJSON | ComfyApiWorkflow> {
|
||||
const api = options?.api ?? false
|
||||
return this.comfyPage.page.evaluate(async (api) => {
|
||||
return (await window.app!.graphToPrompt())[api ? 'output' : 'workflow']
|
||||
|
||||
Reference in New Issue
Block a user