refactor tests for the new connection logic

This commit is contained in:
Fred K. Schott
2019-12-27 09:30:30 -08:00
parent 20d3be0d1d
commit e3822e6bc3
9 changed files with 117 additions and 131 deletions

View File

@@ -14,12 +14,10 @@ export default <TestSuite>{
},
'error': async (api, address) => {
api.connection._send(
JSON.stringify({
command: 'config',
data: {returnErrorOnServerInfo: true}
})
)
api.connection.request({
command: 'config',
data: {returnErrorOnServerInfo: true}
})
try {
await api.getServerInfo()
throw new Error('Should throw NetworkError')
@@ -31,12 +29,10 @@ export default <TestSuite>{
},
'no validated ledger': async (api, address) => {
api.connection._send(
JSON.stringify({
command: 'config',
data: {serverInfoWithoutValidated: true}
})
)
api.connection.request({
command: 'config',
data: {serverInfoWithoutValidated: true}
})
const serverInfo = await api.getServerInfo()
assert.strictEqual(serverInfo.networkLedger, 'waiting')
},