File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ cucumber.defineSupportCode((a) => {
4
4
a . After ( function ( scenario , callback ) {
5
5
const running = this . child != null && typeof this . child . kill === 'function'
6
6
7
- if ( running ) {
8
- this . child . kill ( )
9
- this . child = null
10
- }
11
-
12
7
// stop the proxy if it was started
13
- this . proxy . stop ( callback )
8
+ this . proxy . stop ( ( ) => {
9
+ if ( running ) {
10
+ this . child . kill ( )
11
+ this . child = null
12
+ }
13
+ callback ( )
14
+ } )
14
15
} )
15
16
} )
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ function Proxy () {
9
9
target : 'http://localhost:9876'
10
10
} )
11
11
12
+ self . proxy . on ( 'error' , function proxyError ( err , req , res ) {
13
+ console . log ( 'support/proxy onerror' , err )
14
+ } )
15
+
12
16
self . server = http . createServer ( function ( req , res ) {
13
17
const url = req . url
14
18
const match = url . match ( self . proxyPathRegExp )
@@ -22,6 +26,10 @@ function Proxy () {
22
26
}
23
27
} )
24
28
29
+ self . server . on ( 'clientError' , ( err , socket ) => {
30
+ console . log ( 'support/proxy clientError' , err )
31
+ } )
32
+
25
33
self . start = function ( port , proxyPath , callback ) {
26
34
self . proxyPathRegExp = new RegExp ( '^' + proxyPath + '(.*)' )
27
35
self . server . listen ( port , function ( error ) {
You can’t perform that action at this time.
0 commit comments