Visual script runtime tests live in tests/visual-script-runtime.test.js and run with:
npm testThe test command is:
node --experimental-default-type=module --test tests/*.test.jsAdd or update tests when changing:
- Compile validation.
- Artifact schema fields.
- Program input/output behavior.
- Runtime state hydration or serialization.
- Imported compiled program behavior.
- Block registration behavior.
- Any shared
UnitBlockorScriptManagerbehavior.
Tests import registry helpers from ScriptManager.js, including:
registerBlockTypeclearBlockTypeRegistryForTests
Clear the registry between tests when block type names could leak between cases.
The existing tests define small in-file block classes such as constant, add, input, output, multi-output, and stateful blocks. Prefer that pattern for runtime behavior tests instead of depending on full UI units.
For UI-facing scripting changes, also run the app and verify:
Ctrl+AorCmd+Aopens the block library, unless focus is inside an editable field.- Category filters and search find the expected
UnitCatalog.jsentries. - Wires connect only between matching types.
- The validity badge updates after adding, connecting, deleting, or re-registering units.
Compiledownloads a JSON artifact.Run Compiledlogs a success or meaningful failure.Import Compiledcreates a reusable compiled program unit.