Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
enigmatic00 committed Jun 20, 2016
1 parent a1fa6d6 commit 3dea2e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
47 changes: 23 additions & 24 deletions test/integration/fudd.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,38 @@ describe('fudd integration test', function() {
fudd.setup(config, done);
});

config.exchanges.forEach(function(exchangeDefinition){
it('should verify the exchange ' + exchangeDefinition.name + ' exists', function(done){
config.exchanges.forEach(function(exchangeDefinition) {
it('should verify the exchange ' + exchangeDefinition.name + ' exists', function(done) {
var establishChannel = [fudd._connect.bind(null, config), fudd._createChannel];
series(establishChannel, function(err, connection, channel){
if(err) return done(err);
series(establishChannel, function(err, connection, channel) {
if (err) return done(err);

channel.checkExchange(exchangeDefinition.name, function(err){
if(err) return done(err);
channel.checkExchange(exchangeDefinition.name, function(err) {
if (err) return done(err);

fudd._disconnect(connection, done);
});


})
})
});
});
});

config.queues.forEach(function(queueDefinition){
it('should verify the queue ' + queueDefinition.name + ' exists', function(done){
config.queues.forEach(function(queueDefinition) {
it('should verify the queue ' + queueDefinition.name + ' exists', function(done) {
var establishChannel = [fudd._connect.bind(null, config), fudd._createChannel];
series(establishChannel, function(err, connection, channel){
if(err) return done(err);
series(establishChannel, function(err, connection, channel) {
if (err) return done(err);

channel.checkQueue(queueDefinition.name, function(err){
if(err) return done(err);
channel.checkQueue(queueDefinition.name, function(err) {
if (err) return done(err);

fudd._disconnect(connection, done);
});
})
})
});
});
});

it('should establish channel for messages', function(done){
it('should establish channel for messages', function(done) {
var establishChannel = [fudd._connect.bind(null, config), fudd._createChannel];
series(establishChannel, function(err, connection, channel) {
if (err) return done(err);
Expand All @@ -61,22 +60,22 @@ describe('fudd integration test', function() {
});

// specific tests
it('should publish messages to the fanout', function(){
it('should publish messages to the fanout', function() {
verificationChannel.publish('fanout.fx', 'some.key', new Buffer('message1'));
verificationChannel.publish('fanout.fx', 'key.topic1', new Buffer('message1'));
verificationChannel.publish('fanout.fx', 'key.topic2', new Buffer('message1'));
});

config.queues.forEach(function(queueDefinition){
it('should purge the ' + queueDefinition.name + ' queue', function(done){
verificationChannel.purgeQueue(queueDefinition.name, function(err, ok){
config.queues.forEach(function(queueDefinition) {
it('should purge the ' + queueDefinition.name + ' queue', function(done) {
verificationChannel.purgeQueue(queueDefinition.name, function(err, ok) {
messageCounter += ok.messageCount;
done();
})
});
});
});

it('should have come across corret number of messages', function(){
it('should have come across corret number of messages', function() {
// msg - route
// 1 - fanout to queue1
// 2 - fanout to queue1
Expand Down
4 changes: 2 additions & 2 deletions test/unit/fudd.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('fudd', function() {
mockery.registerMock('./amqp-config-utils.js', {});
Fudd = require('../../lib/fudd.js');
});

before('setup stubs', function() {
callbackSpy = sinon.spy();
connectBindStub = sinon.stub(Fudd._connect, 'bind').returns(boundConnect);
Expand Down Expand Up @@ -144,6 +144,6 @@ describe('fudd', function() {
expect(disconnectStub.args[0]).to.eql([
'connection', callbackSpy
]);
})
});
});
});

0 comments on commit 3dea2e2

Please sign in to comment.