@relaycorp/ws-mock
Advanced tools
Comparing version 1.5.0 to 2.0.0
@@ -12,3 +12,3 @@ /// <reference types="node" /> | ||
receive(): Promise<WSData>; | ||
popLastPeerMessage(): WSData | undefined; | ||
popOldestPeerMessage(): WSData | undefined; | ||
waitForPeerClosure(): Promise<CloseFrame>; | ||
@@ -15,0 +15,0 @@ get peerCloseFrame(): CloseFrame | null; |
@@ -28,10 +28,10 @@ "use strict"; | ||
this.requireConnectionStillOpen(); | ||
const lastMessage = this.popLastPeerMessage(); | ||
if (lastMessage) { | ||
return lastMessage; | ||
const oldestMessage = this.popOldestPeerMessage(); | ||
if (oldestMessage) { | ||
return oldestMessage; | ||
} | ||
return this.peerWebSocket.getLastMessageSent(); | ||
} | ||
popLastPeerMessage() { | ||
return this.peerWebSocket.popLastMessage(); | ||
popOldestPeerMessage() { | ||
return this.peerWebSocket.popOldestMessage(); | ||
} | ||
@@ -38,0 +38,0 @@ async waitForPeerClosure() { |
@@ -33,4 +33,4 @@ "use strict"; | ||
*/ | ||
popLastMessage() { | ||
return this.messagesSent.pop(); | ||
popOldestMessage() { | ||
return this.messagesSent.shift(); | ||
} | ||
@@ -37,0 +37,0 @@ close(code, reason) { |
@@ -12,3 +12,3 @@ /// <reference types="node" /> | ||
receive(): Promise<WSData>; | ||
popLastPeerMessage(): WSData | undefined; | ||
popOldestPeerMessage(): WSData | undefined; | ||
waitForPeerClosure(): Promise<CloseFrame>; | ||
@@ -15,0 +15,0 @@ get peerCloseFrame(): CloseFrame | null; |
@@ -25,10 +25,10 @@ import { MockWebSocket } from './MockWebSocket'; | ||
this.requireConnectionStillOpen(); | ||
const lastMessage = this.popLastPeerMessage(); | ||
if (lastMessage) { | ||
return lastMessage; | ||
const oldestMessage = this.popOldestPeerMessage(); | ||
if (oldestMessage) { | ||
return oldestMessage; | ||
} | ||
return this.peerWebSocket.getLastMessageSent(); | ||
} | ||
popLastPeerMessage() { | ||
return this.peerWebSocket.popLastMessage(); | ||
popOldestPeerMessage() { | ||
return this.peerWebSocket.popOldestMessage(); | ||
} | ||
@@ -35,0 +35,0 @@ async waitForPeerClosure() { |
@@ -30,4 +30,4 @@ import { EventEmitter } from 'events'; | ||
*/ | ||
popLastMessage() { | ||
return this.messagesSent.pop(); | ||
popOldestMessage() { | ||
return this.messagesSent.shift(); | ||
} | ||
@@ -34,0 +34,0 @@ close(code, reason) { |
{ | ||
"name": "@relaycorp/ws-mock", | ||
"version": "1.5.0", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -33,3 +33,3 @@ "email": "no-reply@relaycorp.tech", | ||
"dependencies": { | ||
"ws": "^7.4.4" | ||
"ws": "^7.4.5" | ||
}, | ||
@@ -41,3 +41,3 @@ "peerDependencies": { | ||
"@relaycorp/shared-config": "^1.4.13", | ||
"@types/ws": "^7.4.1", | ||
"@types/ws": "^7.4.2", | ||
"del-cli": "^3.0.0", | ||
@@ -48,4 +48,4 @@ "npm-run-all": "^4.1.5", | ||
"tslint": "^5.20.1", | ||
"typedoc": "^0.20.35", | ||
"typescript": "^4.1.5" | ||
"typedoc": "^0.20.36", | ||
"typescript": "^4.2.4" | ||
}, | ||
@@ -52,0 +52,0 @@ "prettier": "@relaycorp/shared-config/.prettierrc.json", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
49079
Updatedws@^7.4.5