off-sqs-debearloper
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -5,2 +5,2 @@ { | ||
"region": "string" | ||
} | ||
} |
{ | ||
"name": "off-sqs-debearloper", | ||
"description": "Helper app that manages SQS and RabbitMQ transactions", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -1,13 +0,16 @@ | ||
var exec = require('exec'), | ||
offSqs = require('../lib'), | ||
config = require('../lib/config'), | ||
awsConfigFile = require("../aws-config.json"), | ||
queuesSystem = "SQS"; | ||
var exec = require('exec'), | ||
AWS = require('aws-sdk'), | ||
offSqs = require('../lib'), | ||
config = require('../lib/config'), | ||
awsConfigFile = require('../aws-config.json'), | ||
listQueues = require('../lib/listQueues'), | ||
id = (Math.random() * (60 - 1) + 1).toFixed(0), | ||
queuesSystem = "test-SQS", | ||
queueName = queuesSystem+"-"+id; | ||
if(config.env.development){ | ||
queuesSystem = "rabbit"; }; | ||
console.log(config); | ||
queuesSystem = "test-rabbit"; }; | ||
describe('🐗 Send with '+ queuesSystem, function(){ | ||
var queue = "test-"+queuesSystem, | ||
var queue = queueName, | ||
objectSend = {"huba": "LIN"}, | ||
@@ -26,16 +29,24 @@ objectReceived = {}; | ||
}); | ||
}) | ||
}); | ||
after(function(done){ | ||
if(queuesSystem == "SQS"){ | ||
var AWS = require('aws-sdk'); | ||
if(queuesSystem == "test-SQS"){ | ||
AWS.config.update(config.awsConfigFile); | ||
var sqs = new AWS.SQS(); | ||
(function(url){ | ||
var params = { | ||
QueueName: queueName | ||
}; | ||
sqs.getQueueUrl(params, function(err, data) { | ||
if (err){ | ||
console.log(err, err.stack); | ||
}else{ | ||
deleteQueue(data.QueueUrl) | ||
} | ||
}); | ||
var deleteQueue = function(url){ | ||
var params = { | ||
QueueUrl: url | ||
}; | ||
console.log("params: ",params); | ||
@@ -47,9 +58,4 @@ sqs.deleteQueue(params, function(err, data) { | ||
}); | ||
})("https://sqs.us-east-1.amazonaws.com/840068477365/test-SQS"); | ||
//hacer esto de forma dinámica... | ||
console.log("qa enviroment tested") | ||
}; | ||
}else{ | ||
console.log("development enviroment tested") | ||
done(); | ||
@@ -56,0 +62,0 @@ } |
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
14543
355