mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
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.
24 lines
709 B
TypeScript
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)
|
|
})
|
|
})
|