mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-03 18:45:48 +00:00
refactor tests for the new connection logic
This commit is contained in:
@@ -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')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user