[Test] Add integration test: LGraph snapshot (#591)

- Runs basic Litegraph init before performing the snapshot
- Allows a significantly more useful verification of the public API
This commit is contained in:
filtered
2025-02-25 19:58:29 +11:00
committed by GitHub
parent a4b9704a80
commit 2c3535c983
10 changed files with 692 additions and 334 deletions

View File

@@ -0,0 +1,13 @@
import { describe } from "vitest"
import { LGraph } from "@/litegraph"
import { dirtyTest } from "./testExtensions"
describe("LGraph (constructor only)", () => {
dirtyTest("Matches previous snapshot", ({ expect, minimalSerialisableGraph, basicSerialisableGraph }) => {
const minLGraph = new LGraph(minimalSerialisableGraph)
expect(minLGraph).toMatchSnapshot("minLGraph")
const basicLGraph = new LGraph(basicSerialisableGraph)
expect(basicLGraph).toMatchSnapshot("basicLGraph")
})
})