Test mit Jest

Das AI generierte mocking ignorieren, und sauber, wie davor.
This commit is contained in:
chk
2026-05-12 20:40:21 +02:00
parent ba2cc8f6ec
commit 3fa1f76413
6 changed files with 96 additions and 79 deletions

View File

@@ -93,7 +93,9 @@ function optimizeRobot(listFoundMarkers, jsonRobot) {
...entry,
n: 0,
average: null,
deviation: null
deviation: null,
result: "X",
status: "ok"
};
}
@@ -104,12 +106,17 @@ function optimizeRobot(listFoundMarkers, jsonRobot) {
...entry,
n,
average,
deviation
deviation,
result: "X",
status: "ok"
};
});
withStats.status = "ok";
withStats.result = "X";
return withStats;
}
function calculateRotationAngle(listIdAndX, jsonRobot, jointName, method = "tan") {
// Achse finden
const jointInfo = jsonRobot.Joints[jointName];
@@ -212,4 +219,16 @@ async function calculate(foundMarkers, jsonRobot) {
}
module.exports = { calculate, optimizeRobot };
// export { calculate, optimizeRobot };
if (typeof window !== "undefined") {
window.calculate = calculate;
window.optimizeRobot = optimizeRobot;
}
if (typeof module !== "undefined") {
module.exports = {
calculate,
optimizeRobot
};
}