@relaycorp/ws-mock
Advanced tools
Comparing version 1.4.11 to 1.5.0
@@ -8,7 +8,8 @@ /// <reference types="node" /> | ||
private headers; | ||
private url; | ||
protected readonly socket: Socket; | ||
constructor(wsServer: WSServer, headers?: { | ||
readonly [key: string]: string; | ||
}); | ||
}, url?: string); | ||
connect(): Promise<void>; | ||
} |
@@ -8,6 +8,7 @@ "use strict"; | ||
class MockClient extends MockPeer_1.MockPeer { | ||
constructor(wsServer, headers = {}) { | ||
constructor(wsServer, headers = {}, url = '/') { | ||
super(); | ||
this.wsServer = wsServer; | ||
this.headers = headers; | ||
this.url = url; | ||
this.socket = new net_1.Socket(); | ||
@@ -26,2 +27,4 @@ this.socket.on('error', (hadError) => { | ||
}; | ||
// tslint:disable-next-line:no-object-mutation | ||
incomingMessage.url = this.url; | ||
return new Promise((resolve) => { | ||
@@ -28,0 +31,0 @@ this.wsServer.once('connection', resolve); |
@@ -8,7 +8,8 @@ /// <reference types="node" /> | ||
private headers; | ||
private url; | ||
protected readonly socket: Socket; | ||
constructor(wsServer: WSServer, headers?: { | ||
readonly [key: string]: string; | ||
}); | ||
}, url?: string); | ||
connect(): Promise<void>; | ||
} |
@@ -5,6 +5,7 @@ import { IncomingMessage } from 'http'; | ||
export class MockClient extends MockPeer { | ||
constructor(wsServer, headers = {}) { | ||
constructor(wsServer, headers = {}, url = '/') { | ||
super(); | ||
this.wsServer = wsServer; | ||
this.headers = headers; | ||
this.url = url; | ||
this.socket = new Socket(); | ||
@@ -23,2 +24,4 @@ this.socket.on('error', (hadError) => { | ||
}; | ||
// tslint:disable-next-line:no-object-mutation | ||
incomingMessage.url = this.url; | ||
return new Promise((resolve) => { | ||
@@ -25,0 +28,0 @@ this.wsServer.once('connection', resolve); |
{ | ||
"name": "@relaycorp/ws-mock", | ||
"version": "1.4.11", | ||
"version": "1.5.0", | ||
"author": { | ||
@@ -40,3 +40,3 @@ "email": "no-reply@relaycorp.tech", | ||
"@relaycorp/shared-config": "^1.4.13", | ||
"@types/ws": "^7.4.0", | ||
"@types/ws": "^7.4.1", | ||
"del-cli": "^3.0.0", | ||
@@ -47,3 +47,3 @@ "npm-run-all": "^4.1.5", | ||
"tslint": "^5.20.1", | ||
"typedoc": "^0.20.23", | ||
"typedoc": "^0.20.35", | ||
"typescript": "^4.1.5" | ||
@@ -50,0 +50,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49033
779