mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 15:40:10 +00:00
eslint disable next litegraph tests
This commit is contained in:
@@ -32,7 +32,7 @@ describe('LGraphNode', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
origLiteGraph = Object.assign({}, LiteGraph)
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error TODO: Fix after merge - Classes property not in type
|
||||
delete origLiteGraph.Classes
|
||||
|
||||
Object.assign(LiteGraph, {
|
||||
|
||||
@@ -41,6 +41,7 @@ const test = baseTest.extend<TestContext>({
|
||||
await use(reroutesComplexGraph)
|
||||
},
|
||||
setConnectingLinks: async (
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
{},
|
||||
use: (mock: ReturnType<typeof vi.fn>) => Promise<void>
|
||||
) => {
|
||||
|
||||
@@ -28,6 +28,7 @@ interface TestContext {
|
||||
}
|
||||
|
||||
const test = baseTest.extend<TestContext>({
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
network: async ({}, use) => {
|
||||
const graph = new LGraph()
|
||||
const floatingLinks = new Map<number, LLink>()
|
||||
@@ -52,6 +53,7 @@ const test = baseTest.extend<TestContext>({
|
||||
},
|
||||
|
||||
setConnectingLinks: async (
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
{},
|
||||
use: (mock: ReturnType<typeof vi.fn>) => Promise<void>
|
||||
) => {
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { Point, Size } from '@/lib/litegraph/src/interfaces'
|
||||
// TODO: If there's a common test context, use it here
|
||||
// For now, we'll define a simple context for Rectangle tests
|
||||
const test = baseTest.extend<{ rect: Rectangle }>({
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
rect: async ({}, use) => {
|
||||
await use(new Rectangle())
|
||||
}
|
||||
|
||||
@@ -300,7 +300,9 @@ describe('ExecutableNodeDTO Memory Efficiency', () => {
|
||||
expect(dto.inputs).toHaveLength(2) // Copied input data only
|
||||
|
||||
// Should not duplicate heavy node data
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
expect(dto.hasOwnProperty('outputs')).toBe(false) // Outputs not copied
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
expect(dto.hasOwnProperty('widgets')).toBe(false) // Widgets not copied
|
||||
})
|
||||
|
||||
@@ -340,7 +342,9 @@ describe('ExecutableNodeDTO Memory Efficiency', () => {
|
||||
expect(dto.graph).toBe(innerNode.graph)
|
||||
|
||||
// Should not hold heavy references that prevent GC
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
expect(dto.hasOwnProperty('parentGraph')).toBe(false)
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
expect(dto.hasOwnProperty('rootGraph')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -229,7 +229,6 @@ describe('Subgraph slot connections', () => {
|
||||
expect(isSubgraphInput(subgraphInput)).toBe(true)
|
||||
expect(isSubgraphInput(node.inputs[0])).toBe(false)
|
||||
expect(isSubgraphInput(null)).toBe(false)
|
||||
// eslint-disable-next-line unicorn/no-useless-undefined
|
||||
expect(isSubgraphInput(undefined)).toBe(false)
|
||||
expect(isSubgraphInput({})).toBe(false)
|
||||
})
|
||||
@@ -243,7 +242,6 @@ describe('Subgraph slot connections', () => {
|
||||
expect(isSubgraphOutput(subgraphOutput)).toBe(true)
|
||||
expect(isSubgraphOutput(node.outputs[0])).toBe(false)
|
||||
expect(isSubgraphOutput(null)).toBe(false)
|
||||
// eslint-disable-next-line unicorn/no-useless-undefined
|
||||
expect(isSubgraphOutput(undefined)).toBe(false)
|
||||
expect(isSubgraphOutput({})).toBe(false)
|
||||
})
|
||||
|
||||
@@ -58,6 +58,7 @@ export interface SubgraphFixtures {
|
||||
*/
|
||||
export const subgraphTest = test.extend<SubgraphFixtures>({
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
emptySubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
const subgraph = createTestSubgraph({
|
||||
name: 'Empty Test Subgraph',
|
||||
@@ -70,6 +71,7 @@ export const subgraphTest = test.extend<SubgraphFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
simpleSubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
const subgraph = createTestSubgraph({
|
||||
name: 'Simple Test Subgraph',
|
||||
@@ -82,6 +84,7 @@ export const subgraphTest = test.extend<SubgraphFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
complexSubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
const subgraph = createTestSubgraph({
|
||||
name: 'Complex Test Subgraph',
|
||||
@@ -101,6 +104,7 @@ export const subgraphTest = test.extend<SubgraphFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
nestedSubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
const nested = createNestedSubgraphs({
|
||||
depth: 3,
|
||||
@@ -113,6 +117,7 @@ export const subgraphTest = test.extend<SubgraphFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
subgraphWithNode: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
// Create the subgraph definition
|
||||
const subgraph = createTestSubgraph({
|
||||
@@ -140,6 +145,7 @@ export const subgraphTest = test.extend<SubgraphFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
eventCapture: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
const subgraph = createTestSubgraph({
|
||||
name: 'Event Test Subgraph'
|
||||
@@ -191,6 +197,7 @@ export interface EdgeCaseFixtures {
|
||||
*/
|
||||
export const edgeCaseTest = subgraphTest.extend<EdgeCaseFixtures>({
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
circularSubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
const rootGraph = new LGraph()
|
||||
|
||||
@@ -225,6 +232,7 @@ export const edgeCaseTest = subgraphTest.extend<EdgeCaseFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
deeplyNestedSubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
// Create a very deep nesting structure (but not exceeding MAX_NESTED_SUBGRAPHS)
|
||||
const nested = createNestedSubgraphs({
|
||||
@@ -238,6 +246,7 @@ export const edgeCaseTest = subgraphTest.extend<EdgeCaseFixtures>({
|
||||
},
|
||||
|
||||
// @ts-expect-error TODO: Fix after merge - fixture use parameter type
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
maxIOSubgraph: async ({}, use: (value: unknown) => Promise<void>) => {
|
||||
// Create a subgraph with many inputs and outputs
|
||||
const inputs = Array.from({ length: 20 }, (_, i) => ({
|
||||
|
||||
@@ -33,6 +33,7 @@ interface DirtyFixtures {
|
||||
}
|
||||
|
||||
export const test = baseTest.extend<LitegraphFixtures>({
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
minimalGraph: async ({}, use) => {
|
||||
// Before each test function
|
||||
const serialisable = structuredClone(minimalSerialisableGraph)
|
||||
@@ -47,6 +48,7 @@ export const test = baseTest.extend<LitegraphFixtures>({
|
||||
floatingLink as unknown as ISerialisedGraph
|
||||
),
|
||||
linkedNodesGraph: structuredClone(linkedNodes as unknown as ISerialisedGraph),
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
floatingBranchGraph: async ({}, use) => {
|
||||
const cloned = structuredClone(
|
||||
floatingBranch as unknown as ISerialisedGraph
|
||||
@@ -54,6 +56,7 @@ export const test = baseTest.extend<LitegraphFixtures>({
|
||||
const graph = new LGraph(cloned)
|
||||
await use(graph)
|
||||
},
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
reroutesComplexGraph: async ({}, use) => {
|
||||
const cloned = structuredClone(
|
||||
reroutesComplex as unknown as ISerialisedGraph
|
||||
@@ -65,6 +68,7 @@ export const test = baseTest.extend<LitegraphFixtures>({
|
||||
|
||||
/** Test that use {@link DirtyFixtures}. One test per file. */
|
||||
export const dirtyTest = test.extend<DirtyFixtures>({
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
basicSerialisableGraph: async ({}, use) => {
|
||||
if (!basicSerialisableGraph.nodes) throw new Error('Invalid test object')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user