@@ -6,19 +6,18 @@ const expect = require("chai").expect;
6
6
const should = require ( "should" ) ;
7
7
const aws = require ( "aws-sdk" ) ;
8
8
const seeder = require ( "../src/seeder.js" ) ;
9
- const dataApp = require ( "../index.js" ) ;
9
+ const Plugin = require ( "../index.js" ) ;
10
10
11
- const serverlessMock = require ( ' ./serverlessMock' ) ;
11
+ const serverlessMock = require ( " ./serverlessMock" ) ;
12
12
13
13
describe ( "Port function" , function ( ) {
14
14
it ( "Port should return number" , function ( ) {
15
- let service = new dataApp ( serverlessMock , { } ) ;
16
- let myport = service . port ;
17
- assert ( typeof myport , "number" ) ;
15
+ let service = new Plugin ( serverlessMock , { } ) ;
16
+ assert ( typeof service . port , "number" ) ;
18
17
} ) ;
19
18
20
19
it ( "Port value should be >= 0 and < 65536" , function ( ) {
21
- let service = new dataApp ( serverlessMock , { } ) ;
20
+ let service = new Plugin ( serverlessMock , { } ) ;
22
21
http . get ( `http://localhost:${ service . port } ` , function ( response ) {
23
22
assert . equal ( response . statusCode , 200 ) ;
24
23
} ) ;
@@ -37,29 +36,29 @@ describe("Check the dynamodb function",function(){
37
36
} ) ;
38
37
39
38
it ( "Should be an object" , function ( ) {
40
- let dynamoOptions = dataApp . prototype . dynamodbOptions ;
39
+ let dynamoOptions = Plugin . prototype . dynamodbOptions ;
41
40
let raw = new aws . DynamoDB ( dynamoOptions ) ;
42
41
raw . should . be . type ( "object" ) ;
43
42
} ) ;
44
43
45
44
it ( "Should be an object" , function ( ) {
46
- let dynamoOptions = dataApp . prototype . dynamodbOptions ;
45
+ let dynamoOptions = Plugin . prototype . dynamodbOptions ;
47
46
let doc = new aws . DynamoDB ( dynamoOptions ) ;
48
47
doc . should . be . type ( "object" ) ;
49
48
} ) ;
50
49
} ) ;
51
50
52
51
describe ( "Start handler function" , function ( ) {
53
52
it ( "Should not be null" , function ( ) {
54
- let handler = dataApp . prototype . startHandler ;
53
+ let handler = Plugin . prototype . startHandler ;
55
54
assert ( handler = ! null ) ;
56
55
} ) ;
57
56
} ) ;
58
57
59
58
60
59
describe ( "createTable functon" , function ( ) {
61
60
it ( "Should check as a function" , function ( ) {
62
- const tbl = dataApp . prototype . createTable ;
61
+ const tbl = Plugin . prototype . createTable ;
63
62
assert . equal ( typeof tbl , "function" ) ;
64
63
} ) ;
65
64
} ) ;
0 commit comments