UnitTests Sender
This commit is contained in:
23
test/helpers/mockCmdReceiver.js
Normal file
23
test/helpers/mockCmdReceiver.js
Normal file
@@ -0,0 +1,23 @@
|
||||
class MockCmdReceiver {
|
||||
constructor(name = 'receiver') {
|
||||
this.name = name
|
||||
this.calls = []
|
||||
}
|
||||
|
||||
moveTo(oldPos, newPos) {
|
||||
this.calls.push({
|
||||
oldPos,
|
||||
newPos
|
||||
})
|
||||
}
|
||||
|
||||
get callCount() {
|
||||
return this.calls.length
|
||||
}
|
||||
|
||||
lastCall() {
|
||||
return this.calls[this.calls.length - 1]
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MockCmdReceiver
|
||||
Reference in New Issue
Block a user