mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
* Replace test framework: jest -> vitest * nit - remove deprecated npm scripts * Add vitest config * Add a few basic tests * Update actions with vitest params * Add correct expectations * Remove jest config
22 lines
707 B
TypeScript
22 lines
707 B
TypeScript
import { describe, expect } from "vitest"
|
|
import { clamp, LGraphCanvas, LiteGraph } from "@/litegraph"
|
|
import { LiteGraphGlobal } from "@/LiteGraphGlobal"
|
|
import { lgTest } from "./lgTest"
|
|
|
|
describe.concurrent("Litegraph module", () => {
|
|
lgTest("contains a global export", ({ expect }) => {
|
|
expect(LiteGraph).toBeInstanceOf(LiteGraphGlobal)
|
|
expect(LiteGraph.LGraphCanvas).toBe(LGraphCanvas)
|
|
})
|
|
|
|
lgTest("has the same structure", ({ expect }) => {
|
|
const lgGlobal = new LiteGraphGlobal()
|
|
expect(lgGlobal).toMatchSnapshot("minLGraph")
|
|
})
|
|
|
|
lgTest("clamps values", () => {
|
|
expect(clamp(-1.124, 13, 24)).toStrictEqual(13)
|
|
expect(clamp(Infinity, 18, 29)).toStrictEqual(29)
|
|
})
|
|
})
|