Speed testen (anfang)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Robot = require('../robot/Robot')
|
||||
const GCode = require('../robot/GCode.js');
|
||||
const MockCmdReceiver = require('./helpers/mockCmdReceiver')
|
||||
|
||||
describe('Robot.sendCommand & cmdReceivers', () => {
|
||||
@@ -84,6 +85,18 @@ describe('Robot.sendCommand & cmdReceivers', () => {
|
||||
expect(newPos.y).toBe(20)
|
||||
})
|
||||
|
||||
test('newPos enthält aktuelle Motorwerte GCode', () => {
|
||||
const r = new MockCmdReceiver()
|
||||
robot.cmdReceivers.push(r)
|
||||
|
||||
GCode.receiveGCode(robot, "G90 G1 x10 y200 z0 f300")
|
||||
|
||||
robot.sendCommand()
|
||||
|
||||
const { newPos } = r.lastCall()
|
||||
expect(newPos.x).toBe(5) // Dummy Test, soll eventuell anders sein.
|
||||
})
|
||||
|
||||
test('mehrere Receiver werden alle benachrichtigt', () => {
|
||||
const r1 = new MockCmdReceiver('r1')
|
||||
const r2 = new MockCmdReceiver('r2')
|
||||
|
||||
Reference in New Issue
Block a user