Skip to content

Commit aea6366

Browse files
authored
Merge pull request #112 from lakindu95/v1
Unit Testing
2 parents fb6749e + 10a5bc3 commit aea6366

File tree

2 files changed

+5
-56
lines changed

2 files changed

+5
-56
lines changed

test/testItems.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var db = new aws.DynamoDB({ endpoint: "http://localhost:8000" });
1010
var dbClient = new aws.DynamoDB.DocumentClient({ endpoint: "http://localhost:8000"});
1111

1212
describe("#Add Items", function() {
13-
this.timeout(30000);
13+
this.timeout(50000);
1414
it("should add item to table", function(done) {
1515
{
1616
var params = {
@@ -38,7 +38,7 @@ describe("#Add Items", function() {
3838
});
3939

4040
describe("#Update Items", function(){
41-
this.timeout(30000);
41+
this.timeout(50000);
4242
it("should update the items", function(done){
4343
var params = {
4444
TableName:"MyMovie",
@@ -67,7 +67,7 @@ describe("#Update Items", function(){
6767
});
6868

6969
describe("#Delete Items", function(){
70-
this.timeout(30000);
70+
this.timeout(50000);
7171
it("should delete the items", function(done){
7272
var params = {
7373
TableName:"Movies10",
@@ -92,7 +92,7 @@ describe("#Delete Items", function(){
9292
});
9393

9494
describe("#Retrieving from database",function(){
95-
this.timeout(30000);
95+
this.timeout(50000);
9696
var params = {
9797
TableName : "Movies10",
9898
KeyConditionExpression: "#yr = :yyyy",
@@ -105,7 +105,7 @@ describe("#Retrieving from database",function(){
105105
};
106106

107107
it ("Getting data from the table", function(done){
108-
this.timeout(30000);
108+
this.timeout(50000);
109109
dbClient.query(params, function(err, data) {
110110
if (err) {
111111
should.exist(err);

test/testTable.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,57 +11,6 @@ aws.config.update({ accessKeyId: "localAccessKey", secretAccessKey: "localSecret
1111
var db = new aws.DynamoDB({ endpoint: 'http://localhost:8000' });
1212

1313
describe("Check Table operations", function() {
14-
describe("#create table", function() {
15-
this.timeout(50000);
16-
it("should create a table if not existing", function(done) {
17-
var params = {
18-
TableName : "Movies",
19-
KeySchema: [
20-
{ AttributeName: "year", KeyType: "HASH"}, //Partition key
21-
{ AttributeName: "title", KeyType: "RANGE" } //Sort key
22-
],
23-
AttributeDefinitions: [
24-
{ AttributeName: "year", AttributeType: "N" },
25-
{ AttributeName: "title", AttributeType: "S" },
26-
{ AttributeName: "info", AttributeType: "S"}
27-
],
28-
ProvisionedThroughput: {
29-
ReadCapacityUnits: 1,
30-
WriteCapacityUnits: 1
31-
}
32-
};
33-
34-
var create = db.createTable(params, function(err, data) {
35-
if (err) {
36-
should.not.exist(err);
37-
} else {
38-
should.exist(data);
39-
data.TableDescription.should.have.property("TableName","Movies");
40-
assert.isNumber(data.TableDescription.ProvisionedThroughput.WriteCapacityUnits);
41-
42-
}
43-
done();
44-
});
45-
});
46-
});
47-
48-
describe("#delete table", function(){
49-
this.timeout(50000);
50-
it("should delete the table", function(done){
51-
var params = {"TableName":"Movies"};
52-
53-
db.deleteTable(params,function(err,data){
54-
if (err){
55-
should.not.exist(err);
56-
assert.isNull(data);
57-
} else {
58-
should.exist(data);
59-
}
60-
done();
61-
});
62-
});
63-
});
64-
6514
describe("#update table", function(){
6615
this.timeout(50000);
6716
it("should update the table", function(done){

0 commit comments

Comments
 (0)