Skip to content

Commit bb7d82a

Browse files
authored
Merge branch 'alpha' into reconnect-keys
2 parents 2f35a82 + 11169a4 commit bb7d82a

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

integration/test/helper.js

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,6 @@ const defaultConfiguration = {
9393
};
9494

9595
const 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-
};
10696
let parseServer;
10797
let server;
10898

@@ -175,17 +165,18 @@ beforeAll(async () => {
175165

176166
afterEach(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+
191182
module.exports = { twitterAuthData };

0 commit comments

Comments
 (0)