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

@@ -40,14 +40,11 @@ export default function EndNode(props: NodeProps<EndNode>) {
/**
* Functionality for reducing this node into its more compact json program
* @param node the node to reduce
* @param nodes all nodes present
* @param _nodes all nodes present
* @returns Dictionary, {id: node.id}
*/
export function EndReduce(node: Node, nodes: Node[]) {
export function EndReduce(node: Node, _nodes: Node[]) {
// Replace this for nodes functionality
if (nodes.length <= -1) {
console.warn("Impossible nodes length in EndReduce")
}
return {
id: node.id
}
@@ -55,13 +52,9 @@ export function EndReduce(node: Node, nodes: Node[]) {
/**
* Any connection functionality that should get called when a connection is made to this node type (end)
* @param thisNode the node of which the functionality gets called
* @param otherNode the other node which has connected
* @param isThisSource whether this node is the one that is the source of the connection
* @param _thisNode the node of which the functionality gets called
* @param _otherNode the other node which has connected
* @param _isThisSource whether this node is the one that is the source of the connection
*/
export function EndConnects(thisNode: Node, otherNode: Node, isThisSource: boolean) {
// Replace this for connection logic
if (thisNode == undefined && otherNode == undefined && isThisSource == false) {
console.warn("Impossible node connection called in EndConnects")
}
export function EndConnects(_thisNode: Node, _otherNode: Node, _isThisSource: boolean) {
}