File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -93,16 +93,6 @@ const defaultConfiguration = {
9393} ;
9494
9595const openConnections = { } ;
96- const destroyAliveConnections = function ( ) {
97- for ( const socketId in openConnections ) {
98- try {
99- openConnections [ socketId ] . destroy ( ) ;
100- delete openConnections [ socketId ] ;
101- } catch ( e ) {
102- /* */
103- }
104- }
105- } ;
10696let parseServer ;
10797let server ;
10898
@@ -175,17 +165,18 @@ beforeAll(async () => {
175165
176166afterEach ( async ( ) => {
177167 await Parse . User . logOut ( ) ;
178- // Connection close events are not immediate on node 10+... wait a bit
179- await sleep ( 0 ) ;
180- if ( Object . keys ( openConnections ) . length > 0 ) {
181- console . warn ( 'There were open connections to the server left after the test finished' ) ;
182- }
183168 Parse . Storage . _clear ( ) ;
184169 await TestUtils . destroyAllDataPermanently ( true ) ;
185- destroyAliveConnections ( ) ;
186170 if ( didChangeConfiguration ) {
187171 await reconfigureServer ( ) ;
188172 }
189173} ) ;
190174
175+ afterAll ( ( ) => {
176+ // Jasmine process counts as one open connection
177+ if ( Object . keys ( openConnections ) . length > 1 ) {
178+ console . warn ( 'There were open connections to the server left after the test finished' ) ;
179+ }
180+ } ) ;
181+
191182module . exports = { twitterAuthData } ;
You can’t perform that action at this time.
0 commit comments