@@ -56,7 +56,7 @@ function initServer(opt, done) {
56
56
options : opt
57
57
} , function ( err ) {
58
58
expect ( err ) . to . not . exist ;
59
- } ) ;
59
+ } ) ;
60
60
server . start ( done ) ;
61
61
return server ;
62
62
}
@@ -72,10 +72,12 @@ describe('hapi-prerender', function () {
72
72
73
73
var server = new Hapi . Server ( ) ;
74
74
75
+ server . connection ( { host : '127.0.0.1' , port : 8888 } ) ;
76
+
75
77
server . register ( PrerenderPlugin , function ( err ) {
76
78
expect ( err ) . to . not . exist ;
77
79
done ( ) ;
78
- } ) ;
80
+ } ) ;
79
81
80
82
} ) ;
81
83
@@ -198,7 +200,7 @@ describe('hapi-prerender', function () {
198
200
} ) ;
199
201
200
202
it ( 'should return a prerendered gzipped response' , function ( done ) {
201
-
203
+
202
204
Zlib . gzip ( new Buffer ( '<html></html>' , 'utf-8' ) , function ( err , zipped ) {
203
205
Nock ( 'http://service.prerender.io' )
204
206
. get ( '/http://127.0.0.1:8888/foo' )
@@ -240,7 +242,7 @@ describe('hapi-prerender', function () {
240
242
} ) ;
241
243
242
244
it ( 'should include X-Prerender-Token header in request' , function ( done ) {
243
-
245
+
244
246
Nock ( 'http://service.prerender.io' )
245
247
. matchHeader ( 'X-Prerender-Token' , 'MY_TOKEN' )
246
248
. get ( '/http://127.0.0.1:8888/?_escaped_fragment_=' )
@@ -274,7 +276,7 @@ describe('hapi-prerender', function () {
274
276
} ) ;
275
277
276
278
it ( 'should send request to custom service' , function ( done ) {
277
-
279
+
278
280
Nock ( 'http://127.0.0.1:3000' )
279
281
. get ( '/http://127.0.0.1:8888/?_escaped_fragment_=' )
280
282
. reply ( 301 , '<html><body>prerendered!</body></html>' ) ;
@@ -311,7 +313,7 @@ describe('hapi-prerender', function () {
311
313
} ) ;
312
314
313
315
it ( 'should send request to given serviceUrl including token' , function ( done ) {
314
-
316
+
315
317
Nock ( 'http://foo' )
316
318
. matchHeader ( 'X-Prerender-Token' , 'MY_TOKEN' )
317
319
. get ( '/http://127.0.0.1:8888/?_escaped_fragment_=' )
@@ -385,19 +387,19 @@ describe('hapi-prerender', function () {
385
387
} ) ;
386
388
387
389
} ) ;
388
-
390
+
389
391
} ) ;
390
392
391
393
describe ( 'with whitelist option' , function ( ) {
392
-
394
+
393
395
it ( 'should ignore if url is not whitelisted' ) ;
394
396
395
397
it ( 'should return a prerendered response if url is whitelisted' ) ;
396
398
397
399
} ) ;
398
400
399
401
describe ( 'with blacklist option' , function ( ) {
400
-
402
+
401
403
it ( 'should ignore if the url is blacklisted' ) ;
402
404
403
405
it ( 'should return a prerendered response if url is not blacklisted' ) ;
@@ -409,4 +411,3 @@ describe('hapi-prerender', function () {
409
411
} ) ;
410
412
411
413
} ) ;
412
-
0 commit comments