Skip to content

Commit

Permalink
AWS Dynamo test, testing #223
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Aug 29, 2014
1 parent 2165a88 commit 90662fc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"debug": "^1.0.4"
},
"devDependencies": {
"aws-sdk": "^2.0.15",
"hyperquest": "^0.3.0",
"needle": "^0.7.1",
"request": "*",
Expand Down
36 changes: 36 additions & 0 deletions tests/test_aws_dynamo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
var nock = require('../');
var AWS = require('aws-sdk');
var test = require('tap').test;

test('works with dynamodb', function(t) {
var done = false;
var REGION = 'us-east-1';

AWS.config.update({
'region': REGION,
'sslEnabled': true,
'accessKeyId': 'ACCESSKEYID',
'secretAccessKey': 'SECRETACCESSKEY'
});

var db = new AWS.DynamoDB();

nock('https://dynamodb.' + REGION + '.amazonaws.com')
.post('/')
.reply(200, {});

db.getItem(
{
'Key': {
'Artist': {
'S': 'Lady Gaga'
}
},
'TableName': 'Music'
},
function(err, resp) {
if (err) throw err;
t.end();
});
});

0 comments on commit 90662fc

Please sign in to comment.