Compare commits

...

3 Commits

Author SHA1 Message Date
Nathan Nichols
8e9c922e41 adjust 2021-10-05 11:15:53 -07:00
Nathan Nichols
e71123ad9d more debug 2021-10-05 10:57:52 -07:00
Nathan Nichols
248445acd9 DEBUG STUFF 2021-10-05 10:52:51 -07:00
3 changed files with 7 additions and 1 deletions

View File

@@ -84,7 +84,7 @@
"watch": "run-s build:lib --watch", "watch": "run-s build:lib --watch",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"docgen": "typedoc ./src/index.ts", "docgen": "typedoc ./src/index.ts",
"prepublish": "run-s clean build", "prepublish": "npm run clean && npm run build",
"test": "nyc mocha --config=test/.mocharc.json --exit", "test": "nyc mocha --config=test/.mocharc.json --exit",
"test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/**/*.ts ./test/integration/*.ts", "test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/**/*.ts ./test/integration/*.ts",
"test:browser": "npm run build:browserTests && TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/browser/*.ts", "test:browser": "npm run build:browserTests && TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/browser/*.ts",

View File

@@ -216,6 +216,7 @@ export class Connection extends EventEmitter {
* @throws ConnectionError if there is a connection error, RippleError if there is already a WebSocket in existence. * @throws ConnectionError if there is a connection error, RippleError if there is already a WebSocket in existence.
*/ */
public async connect(): Promise<void> { public async connect(): Promise<void> {
console.log('CONNECTING IN CONNECTION.CONNECT')
if (this.isConnected()) { if (this.isConnected()) {
return Promise.resolve() return Promise.resolve()
} }
@@ -325,6 +326,7 @@ export class Connection extends EventEmitter {
if (!this.shouldBeConnected || this.ws == null) { if (!this.shouldBeConnected || this.ws == null) {
throw new NotConnectedError() throw new NotConnectedError()
} }
const [id, message, responsePromise] = this.requestManager.createRequest( const [id, message, responsePromise] = this.requestManager.createRequest(
request, request,
timeout ?? this.config.timeout, timeout ?? this.config.timeout,

View File

@@ -182,6 +182,8 @@ class Client extends EventEmitter {
// eslint-disable-next-line max-lines-per-function -- okay because we have to set up all the connection handlers // eslint-disable-next-line max-lines-per-function -- okay because we have to set up all the connection handlers
public constructor(server: string, options: ClientOptions = {}) { public constructor(server: string, options: ClientOptions = {}) {
super() super()
console.log('CONSTRUCTING CLIENT')
if (typeof server !== 'string' || !/wss?(?:\+unix)?:\/\//u.exec(server)) { if (typeof server !== 'string' || !/wss?(?:\+unix)?:\/\//u.exec(server)) {
throw new ValidationError( throw new ValidationError(
'server URI must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.', 'server URI must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.',
@@ -500,6 +502,8 @@ class Client extends EventEmitter {
* @returns A promise that resolves with a void value when a connection is established. * @returns A promise that resolves with a void value when a connection is established.
*/ */
public async connect(): Promise<void> { public async connect(): Promise<void> {
console.log('CONNECTING IN CLIENT.CONNECT')
return this.connection.connect() return this.connection.connect()
} }