File tree 1 file changed +6
-9
lines changed
packages/net-stubbing/lib/server
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash'
2
2
import Debug from 'debug'
3
3
import isHtml from 'is-html'
4
+ import Promise from 'bluebird'
4
5
import { IncomingMessage } from 'http'
5
6
import {
6
7
RouteMatcherOptionsGeneric ,
@@ -220,17 +221,13 @@ export async function getBodyStream (body: Buffer | string | Readable | undefine
220
221
return writable . end ( )
221
222
}
222
223
223
- delay ? await wait ( sendBody , delay ) : sendBody ( )
224
+ if ( delay ) {
225
+ await Promise . delay ( delay )
226
+ }
224
227
225
- return pt
226
- }
228
+ sendBody ( )
227
229
228
- function wait ( fn , ms ) {
229
- return new Promise ( ( resolve ) => {
230
- setTimeout ( ( ) => {
231
- resolve ( fn ( ) )
232
- } , ms )
233
- } )
230
+ return pt
234
231
}
235
232
236
233
export function mergeDeletedHeaders ( before : CyHttpMessages . BaseMessage , after : CyHttpMessages . BaseMessage ) {
You can’t perform that action at this time.
0 commit comments