mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 23:55:49 +00:00
Edit Client constructor to take a server URI (#1544)
* edit Client * fix TS issues + tests * minor edits * rename ClientBroadcast -> BroadcastClient
This commit is contained in:
@@ -9,7 +9,7 @@ import {Client} from 'xrpl-local'
|
||||
*/
|
||||
export default <TestSuite>{
|
||||
'Client - implicit server port': () => {
|
||||
new Client({server: 'wss://s1.ripple.com'})
|
||||
new Client('wss://s1.ripple.com')
|
||||
},
|
||||
|
||||
'Client invalid options': () => {
|
||||
@@ -18,12 +18,12 @@ export default <TestSuite>{
|
||||
},
|
||||
|
||||
'Client valid options': () => {
|
||||
const client = new Client({server: 'wss://s:1'})
|
||||
const client = new Client('wss://s:1')
|
||||
const privateConnectionUrl = (client.connection as any)._url
|
||||
assert.deepEqual(privateConnectionUrl, 'wss://s:1')
|
||||
},
|
||||
|
||||
'Client invalid server uri': () => {
|
||||
assert.throws(() => new Client({server: 'wss//s:1'}))
|
||||
assert.throws(() => new Client('wss//s:1'))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user