Punkt 2 implementieren GitHub CoPilot

This commit is contained in:
chk
2026-06-08 17:28:43 +02:00
parent 172606c7a3
commit 0109066946
14 changed files with 1239 additions and 518 deletions

View File

@@ -93,4 +93,24 @@ describe('InputWS', () => {
client.close();
});
test('receives GCode text and broadcasts updated position', async () => {
server = http.createServer();
const sharedState = { connectedClients: [], lastCommands: [], lastPings: [] };
const robot = createDummyRobot();
wss = initInputWS(server, robot, GCode, sharedState);
port = await listen(server);
const client = await connectWebSocket(port);
const messagePromise = waitForMessage(client);
client.send('G1 X1 Y2 Z3');
const message = await messagePromise;
const parsed = JSON.parse(message);
expect(parsed.position).toEqual({ x: 1, y: 2, z: 3, a: 0, b: 0, c: 0 });
expect(robot.sendCommand).toHaveBeenCalled();
client.close();
});
});