mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Add tests for resolveInstance
Add tests for the resolveInstance function in clusterctl.
This commit is contained in:
1 parent
bfff297d9a
commit
f8aa947a98
3 files changed
+41
-1
No files matched your search
+8
-1
@@ -36,10 +36,17 @@ class MockConnector extends events.EventEmitter {
|
||||
}
|
||||
|
||||
send(type, data) {
|
||||
this.sentMessages.push({ seq: this._seq, type, data });
|
||||
let message = { seq: this._seq, type, data };
|
||||
this.sentMessages.push(message);
|
||||
setImmediate(() => this.emit('send', message));
|
||||
return this._seq++;
|
||||
}
|
||||
|
||||
close(reason) {
|
||||
this.send('close', { reason });
|
||||
this.disconnect();
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.disconnectCalled = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user