Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing __indexBuildCompletionCallbackForTests callback to serverSta… #5577

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ describe('Cloud Code', () => {
done();
}
);
}, 500);
}, 1000);
});

it('test cloud function return types', function(done) {
Expand Down
2 changes: 1 addition & 1 deletion spec/EnableExpressErrorHandler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Enable express error handler', () => {
masterKey: masterKey,
serverURL: serverUrl,
enableExpressErrorHandler: true,
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise.then(() => {
expect(Parse.applicationId).toEqual('anOtherTestApp');
const app = express();
Expand Down
4 changes: 2 additions & 2 deletions spec/ParseLiveQueryServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('ParseLiveQueryServer', function() {
classNames: ['Yolo'],
},
startLiveQueryServer: true,
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise.then(() => {
expect(parseServer.liveQueryServer).not.toBeUndefined();
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
Expand All @@ -181,7 +181,7 @@ describe('ParseLiveQueryServer', function() {
liveQueryServerOptions: {
port: 22347,
},
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise.then(() => {
expect(parseServer.liveQueryServer).not.toBeUndefined();
expect(parseServer.liveQueryServer.server).not.toBe(
Expand Down
2 changes: 1 addition & 1 deletion spec/ParseServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Server Url Checks', () => {
}
const newConfiguration = Object.assign({}, defaultConfiguration, {
databaseAdapter,
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise.then(() => {
parseServer.handleShutdown();
parseServer.server.close(err => {
Expand Down
2 changes: 1 addition & 1 deletion spec/PostgresInitOptions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function createParseServer(options) {
const parseServer = new ParseServer.default(
Object.assign({}, defaultConfiguration, options, {
serverURL: 'http://localhost:12666/parse',
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise.then(() => {
expect(Parse.applicationId).toEqual('test');
const app = express();
Expand Down
2 changes: 1 addition & 1 deletion spec/RedisCacheAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe_only(() => {
.put(KEY, VALUE, ttl)
.then(() => cache.get(KEY))
.then(value => expect(value).toEqual(VALUE))
.then(wait.bind(null, 2))
.then(wait.bind(null, 500))
.then(() => cache.get(KEY))
.then(value => expect(value).toEqual(null))
);
Expand Down
2 changes: 1 addition & 1 deletion spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const reconfigureServer = changedConfiguration => {
defaultConfiguration,
changedConfiguration,
{
__indexBuildCompletionCallbackForTests: indexBuildPromise =>
serverStartComplete: indexBuildPromise =>
indexBuildPromise.then(() => {
resolve(parseServer);
}, reject),
Expand Down
4 changes: 2 additions & 2 deletions spec/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('server', () => {
appId: 'aTestApp',
masterKey: 'aTestMasterKey',
serverURL: 'http://localhost:12666/parse',
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise.then(() => {
expect(Parse.applicationId).toEqual('aTestApp');
const app = express();
Expand Down Expand Up @@ -332,7 +332,7 @@ describe('server', () => {
appId: 'anOtherTestApp',
masterKey: 'anOtherTestMasterKey',
serverURL: 'http://localhost:12667/parse',
__indexBuildCompletionCallbackForTests: promise => {
serverStartComplete: promise => {
promise
.then(() => {
expect(Parse.applicationId).toEqual('anOtherTestApp');
Expand Down
2 changes: 1 addition & 1 deletion src/Options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export interface ParseServerOptions {
/* Live query server configuration options (will start the liveQuery server) */
liveQueryServerOptions: ?LiveQueryServerOptions;

__indexBuildCompletionCallbackForTests: ?() => void;
serverStartComplete: ?() => void;
}

export interface CustomPagesOptions {
Expand Down
6 changes: 2 additions & 4 deletions src/ParseServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ParseServer {
cloud,
javascriptKey,
serverURL = requiredParameter('You must provide a serverURL!'),
__indexBuildCompletionCallbackForTests = () => {},
serverStartComplete = () => {},
} = options;
// Initialize the node client SDK automatically
Parse.initialize(appId, javascriptKey || 'unused', masterKey);
Expand All @@ -101,9 +101,7 @@ class ParseServer {

// Note: Tests will start to fail if any validation happens after this is called.
if (process.env.TESTING) {
__indexBuildCompletionCallbackForTests(
Promise.all([dbInitPromise, hooksLoadPromise])
);
serverStartComplete(Promise.all([dbInitPromise, hooksLoadPromise]));
}

if (cloud) {
Expand Down