Add test suite — no tests exist #2
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_openscad_parametric_gui#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The repo has 13.5k+ lines of TypeScript across
src/lib/scad/(parser, solver, codegen, geometry),src/components/workbench/, andsrc/pages/, but zero test files. Regressions in the parser, constraint solver, or VFS go unnoticed.Suggested stack: Vitest + @testing-library/react + jsdom (matches the Vite 7 + React 19 toolchain).
Highest-leverage targets (smallest dependencies, most logic surface):
src/lib/scad/parser.ts(642 lines) — tokenization, module-tree buildingsrc/lib/scad/solver.ts(647 lines) — Gauss-Seidel constraint solversrc/lib/scad/constraintCodegen.ts(315 lines) — solve → parameter substitutionsrc/lib/scad/geometry.ts(818 lines) — bounding-box + shape inferencesrc/lib/vfs.ts(217 lines) — IndexedDB-backed VFS (will need fake-indexeddb)Acceptance:
vitest.config.tssrc/lib/scad/npm testruns cleanly in CILabels: test
Triage decision: blocked:needs-decision — needs decompose
Assessment:
Blocking factor: large scope. The acceptance criteria ("Coverage ≥60% on
src/lib/scad/") is multi-day work spanning 4 natural sub-units:parser.ts(642 LOC, pure function) — tokenizer + module-tree builder — vitest-only, no DOM neededsolver.ts+constraintCodegen.ts(647+315 LOC, coupled) — constraint AST + Gauss-Seidel + parameter substitutiongeometry.ts(818 LOC) — bounding-box + shape inferencevfs.ts(217 LOC, IndexedDB-backed) — needsfake-indexeddbshimDecision needed: Should this be split into one sub-issue per chunk above (via a
Decompose:parent), or run whole as a single multi-day session?The Decompose: parent would be the cleaner shape — each sub-issue is independently testable and assignable to one focused session. Either path is valid; removing this label approves the whole shape.
Test suite now exists — this issue is stale. As of commit
1e6a55bthere are 6 vitest files with 55 passing tests:CI (
.forgejo/workflows/ci.yml) runsnpm testvia the build pipeline and is green (run 5498 success on1e6a55b). Remaining gaps vs the issue body: no @testing-library/react/jsdom component tests yet; solver/geometry coverage is exercised indirectly through project-level tests but has no direct unit suite. Closing the loop on component tests would be a separate enhancement card.Test suite landed and pushed as commits
92b3925/dce7303/daeb15eon main. 219/219 tests passing across 12 files (parser, solver, constraintCodegen, constraints, expr, geometry, project, exportSync, sharedParamRows, vfs, plus the bughunt/demo-smoke/equalShared extras). Coverage on src/lib/scad/: 77.35% statements / 66.11% branches / 78.83% functions / 82.25% lines — well above the 60% acceptance bar. vitest.config.ts is in place with v8 coverage and the @ → ./src alias. Closing.