mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
5818ca83a2
* setup ui unit tests * Refactoring, adding connections * Few tweaks * Fix type * Add general test * Refactored and extended test * move to describe * for groups * Add test for converted widgets on missing nodes + fix crash * tidy * mores tests + refactor * throw earlier to get less confusing error * support outputs * more test * add ci action * use lts node * Fix? * Prevent connecting non matching combos * update * accidently removed npm i * Disable logging extension * added step to generate object_info * fix python * install python * install deps * fix cwd? * logging * Fix double resolve * create dir * update pkg
37 lines
767 B
JavaScript
37 lines
767 B
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
const { nop } = require("../utils/nopProxy");
|
|
|
|
function forEachKey(cb) {
|
|
for (const k of [
|
|
"LiteGraph",
|
|
"LGraph",
|
|
"LLink",
|
|
"LGraphNode",
|
|
"LGraphGroup",
|
|
"DragAndScale",
|
|
"LGraphCanvas",
|
|
"ContextMenu",
|
|
]) {
|
|
cb(k);
|
|
}
|
|
}
|
|
|
|
export function setup(ctx) {
|
|
const lg = fs.readFileSync(path.resolve("../web/lib/litegraph.core.js"), "utf-8");
|
|
const globalTemp = {};
|
|
(function (console) {
|
|
eval(lg);
|
|
}).call(globalTemp, nop);
|
|
|
|
forEachKey((k) => (ctx[k] = globalTemp[k]));
|
|
require(path.resolve("../web/lib/litegraph.extensions.js"));
|
|
}
|
|
|
|
export function teardown(ctx) {
|
|
forEachKey((k) => delete ctx[k]);
|
|
|
|
// Clear document after each run
|
|
document.getElementsByTagName("html")[0].innerHTML = "";
|
|
}
|