UnitTest aktualisieren
This commit is contained in:
@@ -33,7 +33,7 @@ describe("TelnetSenderGRBL.execCommand - caseBackward", () => {
|
||||
// y: 0.203 * 180 / PI ≈ 11.64
|
||||
// z: (-0.192 * 180 / PI) - (0.203 * 180 / PI) ≈ -10.99 - 11.64 ≈ -22.63
|
||||
console.log("Actual output:", sender.tSocket.written);
|
||||
expect(sender.tSocket.written).toBe("G1 x0.00 y11.63 z-22.63 f100.00\r\n");
|
||||
expect(sender.tSocket.written.replace("G90 ","")).toBe("G1 x0.00 y11.63 z-22.63 f100.00\r\n");
|
||||
});
|
||||
|
||||
});
|
||||
@@ -23,7 +23,7 @@ describe("WS-SenderGRBL.execCommand", () => {
|
||||
sender.execCommand("G1", mOld, mNew);
|
||||
|
||||
// ✅ verify output
|
||||
expect(sender.tSocket.written).toBe("G1 x12.34 y57.30 z57.30 f2300.00\r\n");
|
||||
expect(sender.tSocket.written).toBe("G90 G1 x12.34 y57.30 z57.30 f2300.00\r\n");
|
||||
});
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ describe("WS-SenderGRBL.execCommand", () => {
|
||||
sender.execCommand("G1", mOld, mNew);
|
||||
|
||||
// ✅ verify output
|
||||
expect(sender.tSocket.written).toBe("G1 x22.50 f2300.00\r\n");
|
||||
expect(sender.tSocket.written).toBe("G90 G1 x22.50 f2300.00\r\n");
|
||||
});
|
||||
|
||||
test("writes correct G-code G92 to mocked WS tSocket", () => {
|
||||
@@ -70,7 +70,7 @@ describe("WS-SenderGRBL.execCommand", () => {
|
||||
sender.execCommand("G92", mOld, mNew);
|
||||
|
||||
// ✅ verify output
|
||||
expect(sender.tSocket.written).toBe("G92 x12.34 y57.30 z57.30 f2300.00\r\n");
|
||||
expect(sender.tSocket.written.replace("G90 ","")).toBe("G92 x12.34 y57.30 z57.30 f2300.00\r\n");
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user