Files
xahau.js/test/client/constructor.ts
Mayukha Vadari 98c9b9bc14 ci: run lint tests (#1603)
* turn on lint tests

* remove tsc

* fix errors in src/utils/hashes

* fix linter errors in src/utils

* fix lint issues in test/

* resolve lint issues in src/client

* resolve dependency cycle

* resolve other linting issues in src/models

* resolve rest of linting issues

* fix tests

* fix linting errors in test/integration

* fix rest of linting issues

* fix test name
2021-10-04 14:10:13 -04:00

26 lines
745 B
TypeScript

import { assert } from 'chai'
import { Client } from 'xrpl-local'
describe('client constructor', function () {
it('Client - implicit server port', function () {
// eslint-disable-next-line no-new -- Testing constructor
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'))
})
})