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' ) ;
87
98describe ( 'service-runner tests' , ( ) => {
@@ -103,18 +102,18 @@ describe( 'service-runner tests', () => {
103102 . finally ( ( ) => process . removeListener ( 'warning' , warningListener ) ) ;
104103 } ) ;
105104
106- // preq prevents the AssertionErrors from surfacing and failing the test
105+ // fetch prevents the AssertionErrors from surfacing and failing the test
107106 // performing the test this way presents them correctly
108107 it ( 'Must increment hitcount metrics when hit, no workers' , ( ) => {
109108 const server = new TestServer ( `${ __dirname } /../utils/simple_config_no_workers.yaml` ) ;
110109 const response = { status : null , body : null } ;
111110 return server . start ( )
112111 . then ( ( ) => {
113- preq . get ( { uri : 'http://127.0.0.1:12345' } ) ;
112+ fetch ( { uri : 'http://127.0.0.1:12345' } ) ;
114113 } )
115114 . delay ( 1000 )
116115 . then ( ( ) => {
117- preq . get ( { uri : 'http://127.0.0.1:9000' } )
116+ fetch ( { uri : 'http://127.0.0.1:9000' } )
118117 . then ( ( res ) => {
119118 response . status = res . status ;
120119 response . body = res . body ;
@@ -136,11 +135,11 @@ describe( 'service-runner tests', () => {
136135 const response = { status : null , body : null } ;
137136 return server . start ( )
138137 . then ( ( ) => {
139- preq . get ( { uri : 'http://127.0.0.1:12345' } ) ;
138+ fetch ( { uri : 'http://127.0.0.1:12345' } ) ;
140139 } )
141140 . delay ( 1000 )
142141 . then ( ( ) => {
143- preq . get ( { uri : 'http://127.0.0.1:9000' } )
142+ fetch ( { uri : 'http://127.0.0.1:9000' } )
144143 . then ( ( res ) => {
145144 response . status = res . status ;
146145 response . body = res . body ;
@@ -162,11 +161,11 @@ describe( 'service-runner tests', () => {
162161 const response = { status : null , body : null } ;
163162 return server . start ( )
164163 . then ( ( ) => {
165- preq . get ( { uri : 'http://127.0.0.1:12345' } ) ;
164+ fetch ( { uri : 'http://127.0.0.1:12345' } ) ;
166165 } )
167166 . delay ( 1000 )
168167 . then ( ( ) => {
169- preq . get ( { uri : 'http://127.0.0.1:9000' } )
168+ fetch ( { uri : 'http://127.0.0.1:9000' } )
170169 . then ( ( res ) => {
171170 response . status = res . status ;
172171 response . body = res . body ;
0 commit comments