Files
xahau.js/test/client/constructor.ts
Mayukha Vadari 8c5bc22317 Lints src/client (#1577)
* lint backoff

* lint wsWrapper

* remove rangeset - not used

* split out connection.ts classes

* lint requestManager

* lint connectionManager

* lint most of connection

* fix most of client

* lint broadcastClient

* resolve more linter issues

* resolve magic numbers

* clean up more linting

* resolve rest of issues

* fix tests

* fix browser tests

* fix tests after rebase

* respond to comments

* fix dependency cycles
2021-10-04 14:10:11 -04:00

25 lines
700 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 as any).url;
assert.deepEqual(privateConnectionUrl, "wss://s:1");
});
it("Client invalid server uri", function () {
assert.throws(() => new Client("wss//s:1"));
});
});