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.1 to 2.5.2

15

build/main/lib/MockServerAction.js

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

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

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

this._wasRun = true;
// 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');
});
// Allow enough time for the client to process any event emitted by the action
await waitForSetImmediate();
}

@@ -83,5 +76,9 @@ }

await mockServer.abort(this.error);
await super.run(mockServer);
}
}
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 {

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

this._wasRun = true;
// 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');
});
// Allow enough time for the client to process any event emitted by the action
await waitForSetImmediate();
}

@@ -73,4 +66,8 @@ }

await mockServer.abort(this.error);
await super.run(mockServer);
}
}
function waitForSetImmediate() {
return new Promise((resolve) => setImmediate(resolve));
}
//# sourceMappingURL=MockServerAction.js.map

2

package.json
{
"name": "@relaycorp/ws-mock",
"version": "2.5.1",
"version": "2.5.2",
"author": {

@@ -5,0 +5,0 @@ "email": "no-reply@relaycorp.tech",

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