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
@@ -28,8 +28,10 @@ function createParseServer(options) {
|
||||
const parseServer = new ParseServer.default(
|
||||
Object.assign({}, defaultConfiguration, options, {
|
||||
serverURL: 'http://localhost:12666/parse',
|
||||
__indexBuildCompletionCallbackForTests: promise => {
|
||||
promise.then(() => {
|
||||
serverStartComplete: error => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
expect(Parse.applicationId).toEqual('test');
|
||||
const app = express();
|
||||
app.use('/parse', parseServer.app);
|
||||
@@ -37,7 +39,7 @@ function createParseServer(options) {
|
||||
const server = app.listen(12666);
|
||||
Parse.serverURL = 'http://localhost:12666/parse';
|
||||
resolve(server);
|
||||
}, reject);
|
||||
}
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user