File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ var should = require ( "should" ) ;
2
+ var request = require ( "request" ) ;
3
+ var expect = require ( "chai" ) . expect ;
4
+ var util = require ( "util" ) ;
5
+
6
+ var assert = require ( 'chai' ) . assert ;
7
+ var config = require ( '../index' ) ;
8
+
9
+ var config
10
+
11
+ describe ( 'Unit Test' , function ( ) {
12
+ it ( 'Check the port' , function ( ) {
13
+ request . get ( 'http://google.lk' , function ( err , response , body ) {
14
+ response . statusCode . should . equal ( 200 ) ;
15
+ body . should . include ( "Test Success" ) ;
16
+ done ( ) ;
17
+ } )
18
+ } ) ;
19
+
20
+ it ( 'Check endpoint' , function ( ) {
21
+ before ( function ( ) {
22
+ config . listen ( 8989 ) ;
23
+ } ) ;
24
+ after ( function ( ) {
25
+ console . log ( 'after' ) ;
26
+ } ) ;
27
+ } ) ;
28
+
29
+ it ( 'Check timeout test to 1000ms' , ( ) => {
30
+ this . timeout ( 1000 ) ;
31
+ assert . ok ( true ) ;
32
+ } ) ;
33
+ } ) ;
34
+
You can’t perform that action at this time.
0 commit comments