File tree 4 files changed +40
-32
lines changed
node-experimental/test/transports
4 files changed +40
-32
lines changed Original file line number Diff line number Diff line change @@ -80,15 +80,17 @@ const defaultOptions = {
80
80
// empty function to keep test output clean
81
81
const consoleWarnSpy = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
82
82
83
- describe ( 'makeNewHttpTransport()' , ( ) => {
84
- afterEach ( ( ) => {
85
- jest . clearAllMocks ( ) ;
86
-
87
- if ( testServer ) {
88
- testServer . close ( ) ;
89
- }
90
- } ) ;
83
+ afterEach ( done => {
84
+ jest . clearAllMocks ( ) ;
85
+
86
+ if ( testServer && testServer . listening ) {
87
+ testServer . close ( done ) ;
88
+ } else {
89
+ done ( ) ;
90
+ }
91
+ } ) ;
91
92
93
+ describe ( 'makeNewHttpTransport()' , ( ) => {
92
94
describe ( '.send()' , ( ) => {
93
95
it ( 'should correctly send envelope to server' , async ( ) => {
94
96
await setupTestServer ( { statusCode : SUCCESS } , ( req , body ) => {
Original file line number Diff line number Diff line change @@ -82,15 +82,17 @@ const defaultOptions = {
82
82
recordDroppedEvent : ( ) => undefined , // noop
83
83
} ;
84
84
85
- describe ( 'makeNewHttpsTransport()' , ( ) => {
86
- afterEach ( ( ) => {
87
- jest . clearAllMocks ( ) ;
88
-
89
- if ( testServer ) {
90
- testServer . close ( ) ;
91
- }
92
- } ) ;
85
+ afterEach ( done => {
86
+ jest . clearAllMocks ( ) ;
87
+
88
+ if ( testServer && testServer . listening ) {
89
+ testServer . close ( done ) ;
90
+ } else {
91
+ done ( ) ;
92
+ }
93
+ } ) ;
93
94
95
+ describe ( 'makeNewHttpsTransport()' , ( ) => {
94
96
describe ( '.send()' , ( ) => {
95
97
it ( 'should correctly send envelope to server' , async ( ) => {
96
98
await setupTestServer ( { statusCode : SUCCESS } , ( req , body ) => {
Original file line number Diff line number Diff line change @@ -83,15 +83,17 @@ const defaultOptions = {
83
83
// empty function to keep test output clean
84
84
const consoleWarnSpy = jest . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
85
85
86
- describe ( 'makeNewHttpTransport()' , ( ) => {
87
- afterEach ( ( ) => {
88
- jest . clearAllMocks ( ) ;
89
-
90
- if ( testServer ) {
91
- testServer . close ( ) ;
92
- }
93
- } ) ;
86
+ afterEach ( done => {
87
+ jest . clearAllMocks ( ) ;
88
+
89
+ if ( testServer && testServer . listening ) {
90
+ testServer . close ( done ) ;
91
+ } else {
92
+ done ( ) ;
93
+ }
94
+ } ) ;
94
95
96
+ describe ( 'makeNewHttpTransport()' , ( ) => {
95
97
describe ( '.send()' , ( ) => {
96
98
it ( 'should correctly send envelope to server' , async ( ) => {
97
99
await setupTestServer ( { statusCode : SUCCESS } , ( req , body ) => {
Original file line number Diff line number Diff line change @@ -84,15 +84,17 @@ const defaultOptions = {
84
84
recordDroppedEvent : ( ) => undefined , // noop
85
85
} ;
86
86
87
- describe ( 'makeNewHttpsTransport()' , ( ) => {
88
- afterEach ( ( ) => {
89
- jest . clearAllMocks ( ) ;
90
-
91
- if ( testServer ) {
92
- testServer . close ( ) ;
93
- }
94
- } ) ;
87
+ afterEach ( done => {
88
+ jest . clearAllMocks ( ) ;
89
+
90
+ if ( testServer && testServer . listening ) {
91
+ testServer . close ( done ) ;
92
+ } else {
93
+ done ( ) ;
94
+ }
95
+ } ) ;
95
96
97
+ describe ( 'makeNewHttpsTransport()' , ( ) => {
96
98
describe ( '.send()' , ( ) => {
97
99
it ( 'should correctly send envelope to server' , async ( ) => {
98
100
await setupTestServer ( { statusCode : SUCCESS } , ( req , body ) => {
You can’t perform that action at this time.
0 commit comments