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

@elastic.io/amqp-rpc

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic.io/amqp-rpc - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json
{
"name": "@elastic.io/amqp-rpc",
"description": "RPC over RabbitMQ for Node.js",
"version": "1.1.1",
"version": "1.1.2",
"homepage": "http://elastic.io",

@@ -6,0 +6,0 @@ "author": "elastic.io GmbH <info@elastic.io>",

@@ -38,8 +38,9 @@ const assert = require('assert');

this._channel = await this._connection.createChannel();
this._queue = await this._channel.assertQueue(this._queueName, {
autoDelete: true,
durabale: true
const queue = await this._channel.assertQueue(this._queueName, {
durable: true
});
this._channel.consume(this._queue.queue, this._handleMessage.bind(this));
return this._queue.queue;
this._queueName = queue.queue;
this._channel.consume(this._queueName, this._handleMessage.bind(this));
return this._queueName;
}

@@ -57,3 +58,3 @@

try {
await channel.deleteQueue(this._queue.name);
await channel.deleteQueue(this._queueName);
} catch (e) {

@@ -60,0 +61,0 @@ //it's ok to ignore this error, as queue

@@ -28,8 +28,11 @@ const assert = require('assert');

describe('#contructor', () => {
it('should set default queueName', () => {
it('should be event emitter', () => {
const receiver = new AMQPEventsReceiver(connectionStub);
expect(receiver).to.be.instanceof(AMQPEventsReceiver);
expect(receiver).to.be.instanceof(EventEmitter);
});
it('should set connection', () => {
const receiver = new AMQPEventsReceiver(connectionStub);
expect(receiver._connection).to.equal(connectionStub);
expect(receiver._queueName).to.equal('');
});

@@ -40,5 +43,2 @@

const receiver = new AMQPEventsReceiver(connectionStub, queueName);
expect(receiver).to.be.instanceof(AMQPEventsReceiver);
expect(receiver).to.be.instanceof(EventEmitter);
expect(receiver._connection).to.equal(connectionStub, queueName);
expect(receiver._queueName).to.equal(queueName);

@@ -71,6 +71,6 @@ });

it('should create amqp queue with autoDelete and durable flags', async () => {
it('should create amqp queue with options', async () => {
const receiver = new AMQPEventsReceiver(connectionStub, 'q');
const queueStub = {
queue: 'q'
queue: 'q1'
};

@@ -80,7 +80,6 @@ channelStub.assertQueue = sinon.stub().returns(Promise.resolve(queueStub));

expect(channelStub.assertQueue).to.have.been.calledOnce
.and.calledWith(receiver._queueName, {
autoDelete: true,
durabale: true
.and.calledWith('q', {
durable: true
});
expect(receiver._queue).to.equal(queueStub);
expect(receiver._queueName).to.equal(queueStub.queue);
expect(queueName).to.equal(queueStub.queue);

@@ -87,0 +86,0 @@ });

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