11'use strict' ;
22
3- const preq = require ( 'preq' ) ;
4-
53const TestServer = require ( '../TestServer' ) ;
64const cluster = require ( 'cluster' ) ;
5+ const fetch = require ( 'node-fetch' ) ;
76const assert = require ( 'assert' ) ;
7+ const Bluebird = require ( 'bluebird' ) ;
8+
9+ fetch . Promise = Bluebird ;
810
911describe ( 'service-runner tests' , ( ) => {
1012 it ( 'Must start and stop a simple service, no workers' , ( ) => {
@@ -103,18 +105,18 @@ describe( 'service-runner tests', () => {
103105 . finally ( ( ) => process . removeListener ( 'warning' , warningListener ) ) ;
104106 } ) ;
105107
106- // preq prevents the AssertionErrors from surfacing and failing the test
108+ // fetch prevents the AssertionErrors from surfacing and failing the test
107109 // performing the test this way presents them correctly
108110 it ( 'Must increment hitcount metrics when hit, no workers' , ( ) => {
109111 const server = new TestServer ( `${ __dirname } /../utils/simple_config_no_workers.yaml` ) ;
110112 const response = { status : null , body : null } ;
111113 return server . start ( )
112114 . then ( ( ) => {
113- preq . get ( { uri : 'http://127.0.0.1:12345' } ) ;
115+ fetch ( { uri : 'http://127.0.0.1:12345' } ) ;
114116 } )
115117 . delay ( 1000 )
116118 . then ( ( ) => {
117- preq . get ( { uri : 'http://127.0.0.1:9000' } )
119+ fetch ( { uri : 'http://127.0.0.1:9000' } )
118120 . then ( ( res ) => {
119121 response . status = res . status ;
120122 response . body = res . body ;
@@ -136,11 +138,11 @@ describe( 'service-runner tests', () => {
136138 const response = { status : null , body : null } ;
137139 return server . start ( )
138140 . then ( ( ) => {
139- preq . get ( { uri : 'http://127.0.0.1:12345' } ) ;
141+ fetch ( { uri : 'http://127.0.0.1:12345' } ) ;
140142 } )
141143 . delay ( 1000 )
142144 . then ( ( ) => {
143- preq . get ( { uri : 'http://127.0.0.1:9000' } )
145+ fetch ( { uri : 'http://127.0.0.1:9000' } )
144146 . then ( ( res ) => {
145147 response . status = res . status ;
146148 response . body = res . body ;
@@ -162,11 +164,11 @@ describe( 'service-runner tests', () => {
162164 const response = { status : null , body : null } ;
163165 return server . start ( )
164166 . then ( ( ) => {
165- preq . get ( { uri : 'http://127.0.0.1:12345' } ) ;
167+ fetch ( { uri : 'http://127.0.0.1:12345' } ) ;
166168 } )
167169 . delay ( 1000 )
168170 . then ( ( ) => {
169- preq . get ( { uri : 'http://127.0.0.1:9000' } )
171+ fetch ( { uri : 'http://127.0.0.1:9000' } )
170172 . then ( ( res ) => {
171173 response . status = res . status ;
172174 response . body = res . body ;
0 commit comments