File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,19 @@ const aws = require ("aws-sdk");
88const seeder = require ( "../src/seeder.js" ) ;
99const dataApp = require ( "../index.js" ) ;
1010
11+ const serverlessMock = require ( './serverlessMock' ) ;
12+
1113describe ( "Port function" , function ( ) {
1214 it ( "Port should return number" , function ( ) {
13- let myport = dataApp . prototype . port ;
15+ let service = new dataApp ( serverlessMock , { } ) ;
16+ let myport = service . port ;
1417 assert ( typeof myport , "number" ) ;
1518 } ) ;
1619
1720 it ( "Port value should be >= 0 and < 65536" , function ( ) {
18- http . get ( `http://localhost:${ dataApp . prototype . port } ` , function ( response ) {
19- assert . equal ( response . statusCode , 200 ) ;
21+ let service = new dataApp ( serverlessMock , { } ) ;
22+ http . get ( `http://localhost:${ service . port } ` , function ( response ) {
23+ assert . equal ( response . statusCode , 200 ) ;
2024 } ) ;
2125 } ) ;
2226} ) ;
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ service : { } ,
3+ cli : {
4+ log : ( ) => { }
5+ } ,
6+ custom : { }
7+ } ;
You can’t perform that action at this time.
0 commit comments