mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 07:14:11 +00:00
Add first test
Why: - Every journey starts with a first step This change addresses the need by: - Adding jest and a test - Resolve ESLint warnings/errors in the tested function
This commit is contained in:
15
src/litegraph.test.js
Normal file
15
src/litegraph.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const lg = require("./litegraph");
|
||||
|
||||
test("Register a node type", () => {
|
||||
function calc_sum(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
lg.LiteGraph.registerNodeType("math/sum", calc_sum);
|
||||
|
||||
let node = lg.LiteGraph.registered_node_types["math/sum"];
|
||||
expect(node).toBeTruthy();
|
||||
expect(node.type).toBe("math/sum");
|
||||
expect(node.title).toBe("calc_sum")
|
||||
expect(node.category).toBe("math");
|
||||
expect(node.prototype.configure).toBe(lg.LGraphNode.prototype.configure);
|
||||
});
|
||||
Reference in New Issue
Block a user