mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
refactor: move fixtures closer to tests (part 2) (#1561)
* move echo * move fee * move subscribe/unsubscribe * move ledger_current * move ledger_data * move submit/submit_multisigned * remove account_tx/account_offers/gateway_balances * move account_info * remove ledger_entry * remove tx * remove account_lines * remove ripple_path_find * remove ledger * remove book_offers * move ping * remove global_config * move test_command * additional mock-rippled cleanup * add explanatory comment to mock.addResponse
This commit is contained in:
@@ -25,8 +25,6 @@ describe('BroadcastClient', function () {
|
||||
this.mocks.forEach((mock) => {
|
||||
mock.addResponse({command: 'server_info'}, rippled.server_info.normal)
|
||||
})
|
||||
const expected = {request_server_info: 1}
|
||||
this.mocks.forEach((mock) => mock.expect(Object.assign({}, expected)))
|
||||
assert(this.client.isConnected())
|
||||
return this.client
|
||||
.request({command: "server_info"})
|
||||
@@ -36,6 +34,10 @@ describe('BroadcastClient', function () {
|
||||
})
|
||||
|
||||
it('error propagation', function (done) {
|
||||
const data = {error: 'type', error_message: 'info'}
|
||||
this.mocks.forEach((mock) => {
|
||||
mock.addResponse({command: 'echo'}, data)
|
||||
})
|
||||
this.client.once('error', (type, info) => {
|
||||
assert.strictEqual(type, 'type')
|
||||
assert.strictEqual(info, 'info')
|
||||
@@ -44,7 +46,7 @@ describe('BroadcastClient', function () {
|
||||
this.client._clients[1].connection
|
||||
.request({
|
||||
command: 'echo',
|
||||
data: {error: 'type', error_message: 'info'}
|
||||
data
|
||||
})
|
||||
.catch(ignoreWebSocketDisconnect)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user