Remove test delays (#5579)
* Changing __indexBuildCompletionCallbackForTests callback to serverStartComplete * Improving serverStartComplete callback to avoid production unhandled promise rejection * Add test to check inexistence of unhandled promise rejection on server fail * Removing some hooks delays * Removing delay after reconfigureServer * Improving code style
This commit is contained in:
committed by
GitHub
parent
2f161c25cd
commit
893f1d376e
@@ -158,12 +158,10 @@ describe('ParseLiveQueryServer', function() {
|
||||
classNames: ['Yolo'],
|
||||
},
|
||||
startLiveQueryServer: true,
|
||||
__indexBuildCompletionCallbackForTests: promise => {
|
||||
promise.then(() => {
|
||||
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
||||
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
|
||||
parseServer.server.close(() => done());
|
||||
});
|
||||
serverStartComplete: () => {
|
||||
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
||||
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
|
||||
parseServer.server.close(done);
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -181,16 +179,14 @@ describe('ParseLiveQueryServer', function() {
|
||||
liveQueryServerOptions: {
|
||||
port: 22347,
|
||||
},
|
||||
__indexBuildCompletionCallbackForTests: promise => {
|
||||
promise.then(() => {
|
||||
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
||||
expect(parseServer.liveQueryServer.server).not.toBe(
|
||||
parseServer.server
|
||||
);
|
||||
parseServer.liveQueryServer.server.close(() => {
|
||||
parseServer.server.close(() => done());
|
||||
});
|
||||
});
|
||||
serverStartComplete: () => {
|
||||
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
||||
expect(parseServer.liveQueryServer.server).not.toBe(
|
||||
parseServer.server
|
||||
);
|
||||
parseServer.liveQueryServer.server.close(
|
||||
parseServer.server.close.bind(parseServer.server, done)
|
||||
);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user