Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@relaycorp/ws-mock

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@relaycorp/ws-mock - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

14

build/main/lib/MockServerAction.js

@@ -5,2 +5,3 @@ "use strict";

exports.EmitClientErrorAction = exports.ReceiveMessageAction = exports.SendMessageAction = exports.CloseConnectionAction = exports.AcceptConnectionAction = exports.MockServerAction = void 0;
const events_1 = require("events");
class MockServerAction {

@@ -17,4 +18,10 @@ constructor() {

this._wasRun = true;
// Allow enough time for the client to process any event emitted by the action
await waitForSetImmediate();
// Allow enough time for the client to process any event emitted by the action. We would
// normally use setImmediate(), but we can't rely on timer functions because they may be
// mocked (e.g., `jest.useFakeTimers()`).
await new Promise((resolve) => {
const events = new events_1.EventEmitter();
events.once('done', resolve);
events.emit('done');
});
}

@@ -79,5 +86,2 @@ }

exports.EmitClientErrorAction = EmitClientErrorAction;
function waitForSetImmediate() {
return new Promise((resolve) => setImmediate(resolve));
}
//# sourceMappingURL=MockServerAction.js.map
// tslint:disable:max-classes-per-file
import { EventEmitter } from 'events';
export class MockServerAction {

@@ -11,4 +12,10 @@ // tslint:disable-next-line:readonly-keyword

this._wasRun = true;
// Allow enough time for the client to process any event emitted by the action
await waitForSetImmediate();
// Allow enough time for the client to process any event emitted by the action. We would
// normally use setImmediate(), but we can't rely on timer functions because they may be
// mocked (e.g., `jest.useFakeTimers()`).
await new Promise((resolve) => {
const events = new EventEmitter();
events.once('done', resolve);
events.emit('done');
});
}

@@ -68,5 +75,2 @@ }

}
function waitForSetImmediate() {
return new Promise((resolve) => setImmediate(resolve));
}
//# sourceMappingURL=MockServerAction.js.map
{
"name": "@relaycorp/ws-mock",
"version": "2.5.0",
"version": "2.5.1",
"author": {

@@ -47,3 +47,3 @@ "email": "no-reply@relaycorp.tech",

"tslint": "^5.20.1",
"typedoc": "^0.21.4",
"typedoc": "^0.21.5",
"typescript": "^4.3.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc