test: create universal tests and rewrite nodes to have optional parameters for more code coverage

ref: N25B-362
This commit is contained in:
Björn Otgaar
2025-12-02 12:01:23 +01:00
parent d4393e7635
commit a95fbd15e6
8 changed files with 153 additions and 94 deletions

View File

@@ -78,8 +78,10 @@ export function PhaseReduce(node: Node, nodes: Node[]) {
.filter(([t]) => !nodesNotInPhase.includes(t))
.map(([t]) => t);
// children nodes
const childrenNodes = nodes.filter((node) => data.children.includes(node.id));
// children nodes - make sure to check for empty arrays
let childrenNodes: any[] = [];
if (data.children)
childrenNodes = nodes.filter((node) => data.children.includes(node.id));
// Build the result object
const result: Record<string, unknown> = {