Files
ComfyUI_frontend/test/litegraph.test.ts
filtered 6224d2dc06 [Cleanup] Update ESLint rules with stricter auto-fixes (#614)
Stylistic plugin falls short in a few areas when it comes to consistent
lists and chaining. Replaced some key rules with antfu's personal
variants.

`eslint` can now be run repo-wide without params.
2025-02-26 11:12:03 +00:00

24 lines
709 B
TypeScript

import { describe, expect } from "vitest"
import { clamp, LGraphCanvas, LiteGraph } from "@/litegraph"
import { LiteGraphGlobal } from "@/LiteGraphGlobal"
import { test } from "./testExtensions"
describe.concurrent("Litegraph module", () => {
test("contains a global export", ({ expect }) => {
expect(LiteGraph).toBeInstanceOf(LiteGraphGlobal)
expect(LiteGraph.LGraphCanvas).toBe(LGraphCanvas)
})
test("has the same structure", ({ expect }) => {
const lgGlobal = new LiteGraphGlobal()
expect(lgGlobal).toMatchSnapshot("minLGraph")
})
test("clamps values", () => {
expect(clamp(-1.124, 13, 24)).toStrictEqual(13)
expect(clamp(Infinity, 18, 29)).toStrictEqual(29)
})
})