Files
workinf_Blender_Wasm/web/tests/unit/generated-gap-preflight.test.mjs
mes123456 603a5a92f2
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
Improve execution preflight diagnostics
2026-08-24 17:04:16 -04:00

29 lines
1.2 KiB
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { collectGeneratedGapPreflight } from "../../../tools/web/generated-gap-preflight.mjs";
import { readIndexedTask, root, verifyTaskIndex } from "../../../tools/web/task-context-lib.mjs";
test("generated gap preflight accepts a runnable task with existing inputs", () => {
verifyTaskIndex();
const entry = readIndexedTask("M16-GAP-00281");
assert.deepEqual(collectGeneratedGapPreflight({ root, task: "M16-GAP-00281", entry }), []);
});
test("generated gap preflight reports state and input failures before WASM startup", () => {
const issues = collectGeneratedGapPreflight({
root,
task: "M16-GAP-00282",
entry: {
id: "M16-GAP-00282",
state: "pending",
fixture: { path: "tests/files/web/generated/does-not-exist.blend" },
desktopCommand: "blender --python tools/web/generated/does-not-exist.py -- fixture.blend",
},
});
assert.deepEqual(issues.map(({ code }) => code), ["TASK_NOT_RUNNABLE", "INPUT_MISSING", "INPUT_MISSING"]);
});
test("generated gap preflight rejects a missing task argument", () => {
assert.deepEqual(collectGeneratedGapPreflight({ root, task: undefined, entry: null }).map(({ code }) => code), ["TASK_ARGUMENT_INVALID"]);
});