test: reuse application analysis across comparison directions

Reuse immutable source graphs for both export comparison orientations and obtain rest-argument seeds from the existing public CLI Evidence. Retain all direction-specific assertions while removing nine repeated application analyses.

Validation: 75 focused tests; covered locations and hit status unchanged across all 1137 source files in controlled before/after coverage runs. Comparison file execution fell from 19.2s to 15.3s locally. Static and generated-document checks passed.
This commit is contained in:
morluto
2026-10-11 18:15:57 +08:00
parent e90acaea67
commit 044c0a92d5
2 changed files with 48 additions and 41 deletions
@@ -694,11 +694,9 @@ describe("rest parameter semantic trace CLI", () => {
root,
"--json",
]);
const analyzed = await analyzeJavaScriptApplication({ input_path: root });
if (!analyzed.ok) throw analyzed.error;
const graph = javascriptApplicationAnalysisResultSchema.parse(
analyzed.value.normalized_result,
).semantic_graph;
const graph = z
.object({ normalized_result: javascriptApplicationAnalysisResultSchema })
.parse(application).normalized_result.semantic_graph;
for (const index of [1, 2]) {
const argument = graph.nodes.find(
({ kind, label }) =>