You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JS test safety net: unit-test infra for wwwroot fragments + lift the codecov wwwroot ignore #356
2026-07-03 architecture audit, highest-risk finding: the frontend is ~72 000 LOC of vanilla JS (41 Core fragments = 60 286 LOC + ~12k LOC of plugin fragments) sharing one closure, and it is almost entirely untested and invisible to coverage:
codecov.yml ignores src/**/wwwroot/** — the whole frontend is excluded from coverage reporting.
2 of 44 Core JS modules have direct tests (history-replay.test.mjs, script-sandbox.test.mjs, both written reactively after bugs). The v2.1 coverage-gap report (Test coverage gap report — v2.1 audit kickoff #312) counted 43/44 untested.
3 Playwright specs exist, all workspace-lifecycle, against a manually started instance on :5180.
render-main.js alone is 10 144 LOC and holds the rail dispatch ladder — zero automated coverage.
This blocks #306/#311 (rail extraction cuts straight through render-main.js) and is the standing regression risk behind the morphdom-class bugs (#346, #349).
Proposal:
Adopt a JS unit-test runner for the node-testable pure modules (the two existing node --test files show the pattern works — scale it; vitest or stay with node --test, decide once)
JS tests now gate CI — a 'JS unit tests' step runs node --test over the 270 wwwroot-js assertions. They existed but never ran in the pipeline, which is exactly how benchmarks.test.mjs had silently rotted to a moved fragment path (benchmarks.js → the Benchmarking package) — fixed here.
Playwright auto-spawns the Tool (webServer) — npm run test:e2e works from a clean checkout; BOWIRE_BASE_URL still targets a dev instance.
codecov — documented why wwwroot stays ignored for the C# report + that JS coverage is tracked separately.
Plus: CLI integration tests (8 xUnit tests driving the real BowireCli.RunAsync — help/dispatch, parse errors, bowire test exit codes, --fail-on never, --workspace, contract publish→verify), exercising option parsing + exit codes as a black box in-process.
Remaining (own follow-ups): a dedicated javascript codecov flag (lcov upload — needs a per-flag ignore) and extracting more pure logic out of render-*.js as #306 proceeds. The CI gate + harness + first helpers coverage are the substance; closing the 'wire it up' core.
Core delivered in 982a274 — the CI-gating blocker (the reason #306 rail extraction was risky) is lifted:
JS tests gate CI (node --test over 270 wwwroot-js assertions); a stale moved-fragment path in benchmarks.test.mjs surfaced + fixed immediately, proving the value.
Activity
test(ci): wire JS tests into CI + CLI integration tests + Playwright …
thomas-stegemann commentedon Jul 3, 2026
First wave shipped (982a274):
node --testover the 270 wwwroot-js assertions. They existed but never ran in the pipeline, which is exactly howbenchmarks.test.mjshad silently rotted to a moved fragment path (benchmarks.js→ the Benchmarking package) — fixed here.test:js,test:js:coverage,test:e2e.list-filter-sort.test.mjssnips the pureapplyListFilterSort/moveInArrayByIdbodies out of the big fragment and tests them; the test-first pattern Pluggable workbench: extract every remaining rail / module to packages + Bundle.Workbench (Phase G follow-up to #294) #306's rail extraction can follow.npm run test:e2eworks from a clean checkout;BOWIRE_BASE_URLstill targets a dev instance.Plus: CLI integration tests (8 xUnit tests driving the real
BowireCli.RunAsync— help/dispatch, parse errors,bowire testexit codes,--fail-on never,--workspace,contract publish→verify), exercising option parsing + exit codes as a black box in-process.Remaining (own follow-ups): a dedicated
javascriptcodecov flag (lcov upload — needs a per-flag ignore) and extracting more pure logic out of render-*.js as #306 proceeds. The CI gate + harness + first helpers coverage are the substance; closing the 'wire it up' core.thomas-stegemann commentedon Jul 3, 2026
Core delivered in 982a274 — the CI-gating blocker (the reason #306 rail extraction was risky) is lifted:
node --testover 270 wwwroot-js assertions); a stale moved-fragment path in benchmarks.test.mjs surfaced + fixed immediately, proving the value.Split out as follow-ups:
javascriptcodecov flag (lcov upload; needs per-flag ignore scoping)Bonus landed alongside: CLI integration tests (8 xUnit tests driving the real
BowireCli.RunAsync— dispatch, parse errors, exit codes, --fail-on, --workspace, contract round-trip).test(e2e): gate CI on the browser suite and pin the streaming-layout …