Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Code cleanup, updated to v0.1.0 and added grunt

  • Loading branch information...
commit 3a64f86c9df4dd4d190471188bf5f69178b1a5ff 1 parent cfb0064
@doug-martin authored
View
74 .jshintrc
@@ -0,0 +1,74 @@
+{
+ "predef": [
+ "jasmine",
+ "spyOn",
+ "it",
+ "console",
+ "describe",
+ "expect",
+ "beforeEach",
+ "afterEach",
+ "waits",
+ "waitsFor",
+ "runs",
+ "$",
+ "jQuery",
+ "_",
+ "require",
+ "define",
+ "sinon",
+ "thumbs"
+ ],
+
+ "node" : true,
+ "browser" : true,
+ "devel" : true,
+ "jquery" : true,
+
+ "bitwise" : false,
+ "camelcase" : true,
+ "curly" : true,
+ "eqeqeq" : true,
+ "forin" : false,
+ "immed" : true,
+ "indent" : 4,
+ "latedef" : true,
+ "newcap" : true,
+ "noarg" : true,
+ "noempty" : true,
+ "nonew" : false,
+ "plusplus" : false,
+ "quotmark" : false,
+ "regexp" : false,
+ "undef" : true,
+ "unused" : true,
+ "strict" : false,
+ "trailing" : true,
+ "white" : false,
+
+ "asi" : false,
+ "boss" : false,
+ "debug" : false,
+ "eqnull" : true,
+ "es5" : true,
+ "esnext" : true,
+ "evil" : false,
+ "expr" : true,
+ "funcscope" : false,
+ "globalstrict" : false,
+ "iterator" : false,
+ "lastsemic" : false,
+ "laxbreak" : false,
+ "laxcomma" : false,
+ "loopfunc" : false,
+ "multistr" : false,
+ "onecase" : false,
+ "proto" : false,
+ "regexdash" : false,
+ "scripturl" : false,
+ "smarttabs" : false,
+ "shadow" : false,
+ "sub" : true,
+ "supernew" : true,
+ "validthis" : false
+}
View
40 Gruntfile.js
@@ -0,0 +1,40 @@
+/*global module:false*/
+module.exports = function (grunt) {
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+
+ jshint: {
+ file: "./lib/**/*.js",
+ options: {
+ jshintrc: '.jshintrc'
+ }
+ },
+
+ it: {
+ all: {
+ src: 'test/**/*.test.js',
+ options: {
+ timeout: 3000, // not fully supported yet
+ reporter: 'dotmatrix'
+ }
+ }
+ },
+ min: {
+ dist: {
+ src: ['<banner:meta.banner>', 'index.js'],
+ dest: '<%= pkg.name %>.min.js'
+ }
+ },
+ watch: {
+ files: '<config:lint.files>',
+ tasks: 'lint it'
+ }
+ });
+
+ // Default task.
+ grunt.registerTask('default', ['jshint', 'it']);
+ grunt.loadNpmTasks('grunt-it');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+
+};
View
22 Readme.md
@@ -1,6 +1,8 @@
-#Amazon lib
+[![Build Status](https://travis-ci.org/doug-martin/amazon-lib.png)](https://travis-ci.org/doug-martin/amazon-lib)
-##Overview
+# Amazon lib
+
+## Overview
Plug-able AWS client with support for
@@ -8,7 +10,7 @@ Plug-able AWS client with support for
* SNS (Simple Notificaton Service)
Can easily be extended and extensions are welcome.
-##Why this library?
+## Why this library?
This library leverages Promises to allow for flow control as well as full error catching, and propogation(Now you have to handle them :) ). Its extensible.
@@ -16,9 +18,9 @@ This library leverages Promises to allow for flow control as well as full error
npm install amazon-lib
-##Usage
+## Usage
-###SQS
+### SQS
Available operations, SEE API for options and description of params
@@ -37,7 +39,7 @@ Available operations, SEE API for options and description of params
* doAction(/*Object*/options)
* Performes the action specified by options.Action, and params required should also be included in the object. This method should be used for any missing API operations.
-WIthout queue
+Without queue
```js
@@ -83,7 +85,7 @@ sqsClient.listQueues("test-queue").then(function(queues){
sqsClient.receiveMessages({maxNumberOfMessages : 3, visibilityTimeout:(1000*60)*2}).then(function(messages){//do something ....}
```
-###SNS
+### SNS
Avaiable operations. See SNS API for description of parameters
@@ -110,7 +112,7 @@ snsClient.publish({
```
-###Product Advertising
+### Product Advertising
Available opertations. See Product Advertising API for description of parameters
@@ -125,12 +127,12 @@ var productClient = new aws.ProductAdvertising({
});
productClient.search({SearchIndex: "Books", Keyword: "Harry Potter"}).then(function(results){
- <Do something with the results>
+ //<Do something with the results>
});
```
-##License
+## License
(The MIT License)
View
39 lib/aws/baseService.js
@@ -1,6 +1,7 @@
var extd = require("../extended"),
- qs = require("querystring");
-xml2js = require('xml2js'),
+ format = extd.format,
+ qs = require("querystring"),
+ xml2js = require('xml2js'),
crypto = require("crypto"),
http = require("http"),
https = require("https");
@@ -10,7 +11,7 @@ var hmacSha256 = function (key, toSign) {
return hash.update(toSign).digest("base64");
};
-var BaseService = extd.declare({
+extd.declare({
instance: {
@@ -59,13 +60,11 @@ var BaseService = extd.declare({
},
doAction: function (options) {
- var ret = new extd.Promise();
if (extd.isObject(options) && !extd.isEmpty(options) && options.action) {
- this.doRequest(this._tranformOptions(options)).then(ret.callback.bind(ret), ret.errback.bind(ret));
+ return this.doRequest(this._tranformOptions(options));
} else {
- ret.errback(new Error("Inalid query params"));
+ return extd.reject(new Error("Inalid query params"));
}
- return ret;
},
@@ -85,7 +84,7 @@ var BaseService = extd.declare({
},
- _makeHeaders: function (body, options) {
+ _makeHeaders: function (body) {
var now = new Date().toUTCString();
var ret = {
Host: this.host,
@@ -108,7 +107,7 @@ var BaseService = extd.declare({
__sign: function (query) {
var sorted = {};
Object.keys(query).sort().forEach(function (key) {
- sorted[key] = query[key]
+ sorted[key] = query[key];
});
var sign = ["POST", this.host, this.path, qs.stringify(sorted)].join("\n")
.replace(/!/g, "%21")
@@ -125,7 +124,7 @@ var BaseService = extd.declare({
var data = '';
//the listener that handles the response chunks
res.on('data', function (chunk) {
- data += chunk.toString()
+ data += chunk.toString();
});
res.on('end', function () {
var parser = new xml2js.Parser();
@@ -137,7 +136,7 @@ var BaseService = extd.declare({
}
}.bind(this));
}.bind(this));
- res.on("error", ret.errback.bind(ret));
+ res.on("error", ret.errback);
return ret;
},
@@ -150,14 +149,14 @@ var BaseService = extd.declare({
var headers = this._makeHeaders(body, options);
var reqOptions = {host: this.__host, path: this.__path, method: 'POST', headers: headers};
var req = (this.useSSL ? this.https : this.http).request(reqOptions, function (res) {
- if (res.statusCode == 200) {
- this.__handleResponse(res).then(ret.callback.bind(ret), ret.errback.bind(this, "error"));
+ if (res.statusCode === 200) {
+ this.__handleResponse(res).then(ret.callback, ret.errback);
} else {
- this.__handleResponse(res).then(ret.errback.bind(this, "error"), ret.errback.bind(this, "error"));
+ this.__handleResponse(res).both(ret.errback);
}
}.bind(this));
req.on("error", function (e) {
- ret.errback("error", e);
+ ret.errback(e);
}.bind(this));
req.write(body);
req.end();
@@ -182,20 +181,18 @@ var BaseService = extd.declare({
setters: {
host: function (host) {
- if ("" != host && host != null) {
+ if ("" !== host && host != null) {
this.__host = host;
}
},
path: function (path) {
- if ("" != path && path != null) {
+ if ("" !== path && path != null) {
//just as a check to make use easier
- path = path.charAt(0) == "/" ? path : "/" + path;
+ path = path.charAt(0) === "/" ? path : "/" + path;
this.__path = path;
}
}
}
}
-});
-
-module.exports = BaseService;
+}).as(module);
View
10 lib/aws/product.js
@@ -1,7 +1,7 @@
var extd = require("../extended"),
BaseService = require("./baseService");
-var ProductService = BaseService.extend({
+BaseService.extend({
instance: {
_providers: null,
@@ -16,14 +16,14 @@ var ProductService = BaseService.extend({
constructor: function (config) {
this._super(arguments);
- if (config.associateTag){
+ if (config.associateTag) {
this._query = {};
extd.merge(this._query, {"Operation": null,
"Service": "AWSECommerceService",
AssociateTag: config.associateTag,
"Region": "US"});
- } else{
- throw Error("Must give an associateTag.")
+ } else {
+ throw new Error("Must give an associateTag.");
}
},
@@ -33,7 +33,7 @@ var ProductService = BaseService.extend({
return this.doRequest(this._query);
},
- lookup: function(query){
+ lookup: function (query) {
this._query.Operation = "ItemLookup";
this._query = extd.merge(this._query, query);
return this.doRequest(this._query);
View
124 lib/aws/sns.js
@@ -1,22 +1,23 @@
+"use strict";
var extd = require("../extended"),
BaseService = require("./baseService");
-BaseService.extend( {
+BaseService.extend({
- instance : {
+ instance: {
- _version : "2010-03-31",
+ _version: "2010-03-31",
- __host : "sns.us-east-1.amazonaws.com",
+ __host: "sns.us-east-1.amazonaws.com",
- __topicArn : null,
+ __topicArn: null,
- addPermission : function(label, actions) {
+ addPermission: function (label, actions) {
if (this.topicArn) {
- var query = {Action : "AddPermission", TopicArn : this.topicArn, label : label};
+ var query = {Action: "AddPermission", TopicArn: this.topicArn, label: label};
if (actions) {
if (extd.isArray(actions)) {
- actions.forEach(function(opt, i) {
+ actions.forEach(function (opt, i) {
query["AWSAccountId." + (i + 1)] = opt.accountId;
query["ActionName." + (i + 1)] = opt.actionName;
});
@@ -26,135 +27,128 @@ BaseService.extend( {
}
return this.doRequest(query);
} else {
- throw Error("Invalid query params.");
+ return extd.reject(new Error("Invalid query params."));
}
} else {
- throw Error("TopicArc required");
+ return extd.reject(new Error("TopicArc required"));
}
},
- removePermission : function(label) {
+ removePermission: function (label) {
if (this.topicArn) {
if (label) {
- var query = {Action : "RemovePermission", TopicArn : this.topicArn, label : label};
+ var query = {Action: "RemovePermission", TopicArn: this.topicArn, label: label};
return this.doRequest(query);
} else {
- throw Error("Invalid query params.");
+ extd.reject(new Error("Invalid query params."));
}
} else {
- throw Error("TopicArc required");
+ extd.reject(new Error("TopicArc required"));
}
},
- createTopic : function(name) {
- var ret = new extd.Promise();
+ createTopic: function (name) {
if (name) {
- var query = {Action : "CreateTopic", Name : name};
- this.doRequest(query).then(function(res) {
+ var query = {Action: "CreateTopic", Name: name};
+ return this.doRequest(query).then(function (res) {
var createTopicResult;
if ((createTopicResult = res.CreateTopicResult) != null) {
- ret.callback(res.CreateTopicResult.TopicArn[0], res);
+ return res.CreateTopicResult.TopicArn[0];
} else {
- ret.errback("Error", res);
+ throw new Error(res);
}
- }.bind(this), ret.errback.bind(this));
+ });
} else {
- throw Error("Invalid query params. name required");
+ return extd.reject(new Error("Invalid query params. name required"));
}
- return ret;
},
- deleteTopic : function() {
+ deleteTopic: function () {
if (this.topicArn) {
- return this.doRequest({Action : "DeleteTopic", TopicArn: this.topicArn});
+ return this.doRequest({Action: "DeleteTopic", TopicArn: this.topicArn});
} else {
- throw Error("TopicArc required");
+ return extd.reject(new Error("TopicArc required"));
}
},
- getTopicAttributes : function() {
- var ret = new extd.Promise();
+ getTopicAttributes: function () {
if (this.topicArn) {
- this.doRequest({Action : "GetTopicAttributes", TopicArn: this.topicArn}).then(function(res) {
+ return this.doRequest({Action: "GetTopicAttributes", TopicArn: this.topicArn}).then(function (res) {
var getTopicResult, attributes, entry;
- if ((getTopicResult = res.GetTopicAttributesResponse.GetTopicAttributesResult[0]) != null && (attributes = getTopicResult.Attributes[0]) && (entry = attributes.entry) != null && extd.isArray(entry)) {
+ if ((getTopicResult = res.GetTopicAttributesResponse.GetTopicAttributesResult[0]) != null &&
+ (attributes = getTopicResult.Attributes[0]) && (entry = attributes.entry) != null &&
+ extd.isArray(entry)) {
var retValue = {};
- entry.forEach(function(e) {
+ entry.forEach(function (e) {
retValue[e.key[0]] = e.value[0];
});
- ret.callback(retValue, res);
+ return retValue;
} else {
- ret.errback("Error", res);
+ throw new Error(res);
}
- }.bind(this), ret.errback.bind(this));
+ });
} else {
- throw Error("TopicArc required");
+ return extd.reject(new Error("TopicArc required"));
}
- return ret;
},
- publish : function(options) {
- var ret = new extd.Promise();
+ publish: function (options) {
if (this.topicArn) {
if (extd.isObject(options) && !extd.isEmpty(options) && options.message) {
- var query = extd.merge({Action : "Publish", TopicArn: this.topicArn}, this._tranformOptions(options));
- this.doRequest(query).then(function(res) {
+ var query = extd.merge({Action: "Publish", TopicArn: this.topicArn}, this._tranformOptions(options));
+ return this.doRequest(query).then(function (res) {
var publishResponse = res.PublishResponse, publishResult;
if (publishResponse != null && ((publishResult = publishResponse.PublishResult[0]) != null)) {
- ret.callback(publishResult.MessageId[0], res);
+ return publishResult.MessageId[0];
} else {
- ret.errback("Error", res);
+ throw new Error(res);
}
- }.bind(this), ret.errback.bind(this));
+ });
} else {
- throw Error("Invalid query params, message required");
+ return extd.reject(new Error("Invalid query params, message required"));
}
} else {
- throw Error("TopicArc required");
+ return extd.reject(new Error("TopicArc required"));
}
- return ret;
},
- subscribe : function(options) {
- var ret = new extd.Promise();
+ subscribe: function (options) {
if (this.topicArn) {
if (extd.isObject(options) && !extd.isEmpty(options) && options.endpoint && options.protocol) {
- var query = extd.merge({Action : "Subscribe", TopicArn: this.topicArn}, this._tranformOptions(options));
- this.doRequest(query).then(function(res) {
+ var query = extd.merge({Action: "Subscribe", TopicArn: this.topicArn}, this._tranformOptions(options));
+ return this.doRequest(query).then(function (res) {
var subscribeResponse = res.SubscribeResponse;
- if ((subscribeResult = subscribeResponse.SubscribeResult[0]) != null) {
- ret.callback(subscribeResult.SubscriptionArn[0], res);
+ if ((subscribeResponse = subscribeResponse.SubscribeResult[0]) != null) {
+ return subscribeResponse.SubscriptionArn[0];
} else {
- ret.errback("Error", res);
+ throw new Error(res);
}
- }.bind(this), ret.errback.bind(this));
+ });
} else {
- throw Error("Invalid query params, protocol and endpoint required");
+ return extd.reject(new Error("Invalid query params, protocol and endpoint required"));
}
} else {
- throw Error("TopicArc required");
+ return extd.reject(new Error("TopicArc required"));
}
- return ret;
},
- unSubscribe : function() {
+ unSubscribe: function () {
if (this.topicArn) {
- return this.doRequest({Action : "Unsubscribe", SubscriptionArn: this.topicArn});
+ return this.doRequest({Action: "Unsubscribe", SubscriptionArn: this.topicArn});
} else {
- throw Error("TopicArc required");
+ return extd.reject(new Error("TopicArc required"));
}
},
-
- getters : {
- topicArn : function() {
+ getters: {
+ topicArn: function () {
return this.__topicArn;
}
},
- setters : {
- topicArn : function(topicArn) {
+ setters: {
+ topicArn: function (topicArn) {
if (topicArn !== "" && topicArn != null) {
this.__topicArn = topicArn;
}
View
104 lib/aws/sqs.js
@@ -3,82 +3,79 @@ var extd = require("../extended"),
BaseService.extend({
- instance : {
+ instance: {
- __queue : "",
+ __queue: "",
- __host : "sqs.us-east-1.amazonaws.com",
+ __host: "sqs.us-east-1.amazonaws.com",
- _version : "2012-11-05",
+ _version: "2012-11-05",
- constructor : function(options) {
+ constructor: function () {
this._super(arguments);
},
- listQueues : function(queueNamePrefix) {
- var opts = {Action : "ListQueues"};
- var ret = new extd.Promise();
+ listQueues: function (queueNamePrefix) {
+ var opts = {Action: "ListQueues"};
queueNamePrefix && (opts.QueueNamePrefix = queueNamePrefix);
- this.doRequest(opts).then(function(result) {
+ return this.doRequest(opts).then(function (result) {
var res = result.ListQueuesResponse.ListQueuesResult[0];
var urls = res.QueueUrl[0];
if (!extd.isArray(urls)) {
urls = [urls];
}
- ret.callback(urls, result)
- }.bind(this), ret.errback.bind(ret));
- return ret;
+ return urls;
+ });
},
- deleteQueue : function() {
- return this.doRequest({Action : "DeleteQueue"});
+ deleteQueue: function () {
+ return this.doRequest({Action: "DeleteQueue"});
},
- deleteMessage : function(receiptHandle) {
+ deleteMessage: function (receiptHandle) {
if (receiptHandle) {
- var query = {Action : "DeleteMessage", ReceiptHandle : receiptHandle};
+ var query = {Action: "DeleteMessage", ReceiptHandle: receiptHandle};
return this.doRequest(query);
} else {
- throw Error("Invalid query params.");
+ return extd.reject(new Error("Invalid query params."));
}
},
- receiveMessages : function(options) {
- var ret = new extd.Promise();
- var query = {Action : "ReceiveMessage"};
+ receiveMessages: function (options) {
+ var query = {Action: "ReceiveMessage"};
if (extd.isObject(options) && !extd.isEmpty(options)) {
extd.merge(query, this._tranformOptions(options));
}
- var transformMessage = function(m) {
+ var transformMessage = function (m) {
return {
- messageId : m.MessageId,
- receiptHandle : m.ReceiptHandle,
- md5OfBody : m.MD5OfBody, body : m.Body,
- attributes : (m.Attribute || []).map(function(a) {
- return {name : a.Name, value : a.value };
+ messageId: m.MessageId,
+ receiptHandle: m.ReceiptHandle,
+ md5OfBody: m.MD5OfBody,
+ body: m.Body,
+ attributes: (m.Attribute || []).map(function (a) {
+ return {name: a.Name, value: a.value };
})
};
};
- this.doRequest(query).then(function(res) {
+ return this.doRequest(query).then(function (res) {
var receiveMessageResult, messages;
if (res && (receiveMessageResult = res.ReceiveMessageResult) != null && (messages = receiveMessageResult.Message) != null) {
if (extd.isArray(messages)) {
- ret.callback(messages.map(transformMessage), res);
+ return messages.map(transformMessage);
} else if (extd.isObject(messages)) {
- ret.callback([transformMessage(messages)]);
+ return [transformMessage(messages)];
}
} else {
- ret.callback([], res);
+ return [];
}
- }.bind(this), ret.errback.bind(ret));
- return ret;
+ });
},
- addPermission : function(label, actions) {
- var query = {Action : "AddPermission",label : label};
+ addPermission: function (label, actions) {
+ var query = {Action: "AddPermission", label: label};
if (actions) {
if (extd.isArray(actions)) {
- actions.forEach(function(opt, i) {
+ actions.forEach(function (opt, i) {
query["AWSAccountId." + (i + 1)] = opt.accountId;
query["ActionName." + (i + 1)] = opt.actionName;
});
@@ -88,51 +85,48 @@ BaseService.extend({
}
return this.doRequest(query);
} else {
- throw Error("Invalid query params.");
+ return extd.reject(new Error("Invalid query params."));
}
},
- removePermission : function(label) {
+ removePermission: function (label) {
if (label) {
- var query = {Action : "RemovePermission", label : label};
+ var query = {Action: "RemovePermission", label: label};
return this.doRequest(query);
} else {
- throw Error("Invalid query params.");
+ return extd.reject(new Error("Invalid query params."));
}
},
- sendMessage : function(messageBody) {
- var ret = new extd.Promise();
+ sendMessage: function (messageBody) {
if (messageBody) {
- var query = {Action:"SendMessage", MessageBody : messageBody};
- this.doRequest(query).then(function(res) {
+ var query = {Action: "SendMessage", MessageBody: messageBody};
+ return this.doRequest(query).then(function (res) {
var result = res.SendMessageResponse.SendMessageResult[0];
- var r = {md5OfMessageBody : result.MD5OfMessageBody[0], result : result.MessageId[0]};
- ret.callback(r, res);
- }.bind(this), ret.errback.bind(ret));
+ return {md5OfMessageBody: result.MD5OfMessageBody[0], result: result.MessageId[0]};
+ }.bind(this));
} else {
- throw Error("Invalid query params.");
+ return extd.reject(new Error("Invalid query params."));
}
- return ret;
},
- changeMessageVisibility : function(receiptHandle, visibilityTimeout) {
+ changeMessageVisibility: function (receiptHandle, visibilityTimeout) {
if (receiptHandle && !isNaN(visibilityTimeout)) {
- var query = {Action : "ChangeMessageVisibility", ReceiptHandle : receiptHandle, VisibilityTimeout : visibilityTimeout};
+ var query = {Action: "ChangeMessageVisibility", ReceiptHandle: receiptHandle, VisibilityTimeout: visibilityTimeout};
return this.doRequest(query);
} else {
- throw Error("Invalid query params.");
+ return extd.reject(new Error("Invalid query params."));
}
},
- getters : {
- version : function() {
+ getters: {
+ version: function () {
return this.__version;
}
},
- setters : {
- version : function() {
+ setters: {
+ version: function () {
return this.__version;
}
}
View
19 package.json
@@ -1,16 +1,22 @@
{
"name": "amazon-lib",
"description": "AWS Library",
- "version": "0.0.2",
- "keywords" : ["Amazon", "AWS", "SQS", "SNS"],
+ "version": "0.1.0",
+ "keywords": [
+ "Amazon",
+ "AWS",
+ "SQS",
+ "SNS",
+ "Amazon Product API"
+ ],
"repository": {
"type": "git",
"url": "git@github.com:doug-martin/amazon-lib.git"
},
"author": "Doug Martin",
"main": "index.js",
- "dependencies" : {
- "xml2js" : ">=0.1.11",
+ "dependencies": {
+ "xml2js": ">=0.1.11",
"extended": "~0.0.3",
"declare.js": "~0.0.4",
"promise-extended": "~0.0.4",
@@ -27,5 +33,10 @@
},
"engines": {
"node": ">= 0.4.4"
+ },
+ "devDependencies": {
+ "grunt-it": "~0.3.0",
+ "grunt": "~0.4.1",
+ "grunt-contrib-jshint": "~0.3.0"
}
}
View
11 test/sns.test.js
@@ -25,7 +25,6 @@ it.describe("Make a call to the amazon sns",function (it) {
protocol: "protocol",
endpoint: "endpoint"
}, requiredOptions);
- ;
function createMockHttp(assertOptions, assertBody, xmlData) {
mockHttp = new MockHttp(assertOptions, assertBody, xmlData);
@@ -55,7 +54,7 @@ it.describe("Make a call to the amazon sns",function (it) {
return snsClient.addPermission(testSearchOptions, {}).then(function (results) {
assert.equal(results.test, "test");
assert.equal(mockHttps.requestCount, 1);
- })
+ });
});
it.should("remove permission", function () {
@@ -123,7 +122,7 @@ it.describe("Make a call to the amazon sns",function (it) {
var snsClient = new aws.SNSClient(extd.merge(testSearchOptions, {http: mockHttp, https: mockHttps}));
return snsClient.getTopicAttributes(testSearchOptions).then(function () {
assert.equal(mockHttps.requestCount, 1);
- })
+ });
});
it.should("publish", function () {
@@ -140,7 +139,7 @@ it.describe("Make a call to the amazon sns",function (it) {
return snsClient.publish(testPublishOptions).then(function (res) {
assert.equal(res, '94f20ce6-13c5-43a0-9a9e-ca52d816e90b');
assert.equal(mockHttps.requestCount, 1);
- })
+ });
});
it.should("subscribe", function () {
@@ -157,7 +156,7 @@ it.describe("Make a call to the amazon sns",function (it) {
return snsClient.subscribe(testSubscribeOptions).then(function (res) {
assert.equal(res, 'pending confirmation');
assert.equal(mockHttps.requestCount, 1);
- })
+ });
});
it.should("unSubscribe", function () {
@@ -173,6 +172,6 @@ it.describe("Make a call to the amazon sns",function (it) {
var snsClient = new aws.SNSClient(extd.merge(testSearchOptions, {http: mockHttp, https: mockHttps}));
return snsClient.unSubscribe(testSearchOptions).then(function () {
assert.equal(mockHttps.requestCount, 1);
- })
+ });
});
}).as(module);
Please sign in to comment.
Something went wrong with that request. Please try again.