mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
* [Test] Revert custom name for test context - Removes "lgTest", replaces with default "test" * nit - Rename test extensions file * Split test graphs out to separate file
28 lines
968 B
TypeScript
28 lines
968 B
TypeScript
import { test as baseTest } from "vitest"
|
|
import type { ISerialisedGraph, SerialisableGraph } from "../src/types/serialisation"
|
|
import { LGraph } from "@/LGraph"
|
|
import { basicSerialisableGraph, minimalSerialisableGraph, oldSchemaGraph } from "./assets/testGraphs"
|
|
|
|
interface LitegraphFixtures {
|
|
minimalGraph: LGraph
|
|
minimalSerialisableGraph: SerialisableGraph
|
|
basicSerialisableGraph: SerialisableGraph
|
|
oldSchemaGraph: ISerialisedGraph
|
|
}
|
|
|
|
export const test = baseTest.extend<LitegraphFixtures>({
|
|
minimalGraph: async ({ }, use) => {
|
|
// Before each test function
|
|
const serialisable = structuredClone(minimalSerialisableGraph)
|
|
const lGraph = new LGraph(serialisable)
|
|
|
|
// use the fixture value
|
|
await use(lGraph)
|
|
|
|
// After each test function
|
|
},
|
|
basicSerialisableGraph: structuredClone(basicSerialisableGraph),
|
|
minimalSerialisableGraph: structuredClone(minimalSerialisableGraph),
|
|
oldSchemaGraph: structuredClone(oldSchemaGraph),
|
|
})
|