Files
workinf_Blender_Wasm/web/tests/unit/generated-gap-preflight.test.mjs
mes123456 a081c68c87
Some checks are pending
M6 deployable RC / quick (push) Waiting to run
M6 deployable RC / chromium (push) Blocked by required conditions
M6 deployable RC / release (push) Blocked by required conditions
Reorganize Blender Web execution around capabilities
2026-08-24 18:37:46 -04:00

29 lines
1.3 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("M16-GAP-00281");
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"]);
});