Files
xahau.js/test/client/constructor.ts
Mukul Jangid 10445cff01 Refactor: Lint test/client (#1602)
* lint test/client
2021-10-04 14:10:13 -04:00

25 lines
683 B
TypeScript

import { assert } from 'chai'
import { Client } from 'xrpl-local'
describe('client constructor', function () {
it('Client - implicit server port', function () {
new Client('wss://s1.ripple.com')
})
it('Client invalid options', function () {
// @ts-expect-error - This is intentionally invalid
assert.throws(() => new Client({ invalid: true }))
})
it('Client valid options', function () {
const client = new Client('wss://s:1')
const privateConnectionUrl = client.connection.getUrl()
assert.deepEqual(privateConnectionUrl, 'wss://s:1')
})
it('Client invalid server uri', function () {
assert.throws(() => new Client('wss//s:1'))
})
})