@@ -20,6 +20,9 @@ describe('https tests with external module', () => {
20
20
afterEach ( async ( ) => {
21
21
await liveServer . shutdown ( )
22
22
} )
23
+ it ( 'protocol should be https' , function ( ) {
24
+ expect ( liveServer . protocol ) . toBe ( 'https' )
25
+ } )
23
26
it ( 'should reply with a correct index file' , function ( done ) {
24
27
request ( liveServer . httpServer )
25
28
. get ( '/index.html' )
@@ -48,6 +51,40 @@ describe('https tests with object', () => {
48
51
afterEach ( async ( ) => {
49
52
await liveServer . shutdown ( )
50
53
} )
54
+ it ( 'protocol should be https' , function ( ) {
55
+ expect ( liveServer . protocol ) . toBe ( 'https' )
56
+ } )
57
+ it ( 'should reply with a correct index file' , function ( done ) {
58
+ request ( liveServer . httpServer )
59
+ . get ( '/index.html' )
60
+ . expect ( 'Content-Type' , 'text/html; charset=UTF-8' )
61
+ . expect ( / H e l l o w o r l d / i)
62
+ . expect ( 200 , done )
63
+ } )
64
+ it ( 'should support head request' , function ( done ) {
65
+ request ( liveServer . httpServer )
66
+ . head ( '/index.html' )
67
+ . expect ( 'Content-Type' , 'text/html; charset=UTF-8' )
68
+ . expect ( 200 , done )
69
+ } )
70
+ } )
71
+
72
+ describe ( 'https tests with the "selfsigned" package' , ( ) => {
73
+ const opts = {
74
+ root : path . join ( __dirname , 'data' ) ,
75
+ port : 0 ,
76
+ open : false ,
77
+ https : true
78
+ }
79
+ beforeEach ( async ( ) => {
80
+ await liveServer . start ( opts )
81
+ } )
82
+ afterEach ( async ( ) => {
83
+ await liveServer . shutdown ( )
84
+ } )
85
+ it ( 'protocol should be https' , function ( ) {
86
+ expect ( liveServer . protocol ) . toBe ( 'https' )
87
+ } )
51
88
it ( 'should reply with a correct index file' , function ( done ) {
52
89
request ( liveServer . httpServer )
53
90
. get ( '/index.html' )
0 commit comments