mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 08:49:36 +00:00
Replace test framework: jest -> vitest (#281)
* 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
This commit is contained in:
21
test/litegraph.test.ts
Normal file
21
test/litegraph.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user