mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
respond to comments
This commit is contained in:
@@ -48,17 +48,12 @@ function createLedgerResponse(request, response) {
|
|||||||
return JSON.stringify(newResponse);
|
return JSON.stringify(newResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CustomWebSocketServer extends WebSocketServer, EventEmitter2 {
|
// We mock out WebSocketServer in these tests and add a lot of custom
|
||||||
expectedRequests: any
|
// properties not defined on the normal WebSocketServer object.
|
||||||
expect: any
|
type MockedWebSocketServer = any;
|
||||||
config: any
|
|
||||||
socket: any
|
|
||||||
onAny: any
|
|
||||||
event: any
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createMockRippled(port) {
|
export function createMockRippled(port) {
|
||||||
const mock = new WebSocketServer({ port: port }) as CustomWebSocketServer;
|
const mock = new WebSocketServer({ port: port }) as MockedWebSocketServer;
|
||||||
_.assign(mock, EventEmitter2.prototype);
|
_.assign(mock, EventEmitter2.prototype);
|
||||||
|
|
||||||
const close = mock.close;
|
const close = mock.close;
|
||||||
|
|||||||
Reference in New Issue
Block a user