Fix jasmine 3.4 (#5573)
* Fix failing tests * just ignore the test for now. * Bumping jasmine * Fix pg unhandled exception * Improving the way the test is fixed * Fix unhandled failed promise in postgres test * Solving unhandled promise fail on redis test * Returning the excluded test * Fixing package-lock * Fix unhandled promise from redis test
This commit is contained in:
committed by
Arthur Cinader
parent
9232fcc601
commit
81ecf2fd74
16
package-lock.json
generated
16
package-lock.json
generated
@@ -6003,19 +6003,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jasmine": {
|
"jasmine": {
|
||||||
"version": "3.1.0",
|
"version": "3.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.4.0.tgz",
|
||||||
"integrity": "sha1-K9Wf1+xuwOistk4J9Fpo7SrRlSo=",
|
"integrity": "sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"glob": "^7.0.6",
|
"glob": "^7.1.3",
|
||||||
"jasmine-core": "~3.1.0"
|
"jasmine-core": "~3.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jasmine-core": {
|
"jasmine-core": {
|
||||||
"version": "3.1.0",
|
"version": "3.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.4.0.tgz",
|
||||||
"integrity": "sha1-pHheE11d9lAk38kiSVPfWFvSdmw=",
|
"integrity": "sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"jasmine-spec-reporter": {
|
"jasmine-spec-reporter": {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
"flow-bin": "0.98.1",
|
"flow-bin": "0.98.1",
|
||||||
"gaze": "1.1.3",
|
"gaze": "1.1.3",
|
||||||
"husky": "2.2.0",
|
"husky": "2.2.0",
|
||||||
"jasmine": "3.1.0",
|
"jasmine": "3.4.0",
|
||||||
"jasmine-spec-reporter": "4.2.1",
|
"jasmine-spec-reporter": "4.2.1",
|
||||||
"jsdoc": "3.6.1",
|
"jsdoc": "3.6.1",
|
||||||
"jsdoc-babel": "0.5.0",
|
"jsdoc-babel": "0.5.0",
|
||||||
|
|||||||
@@ -158,11 +158,14 @@ describe('ParseLiveQueryServer', function() {
|
|||||||
classNames: ['Yolo'],
|
classNames: ['Yolo'],
|
||||||
},
|
},
|
||||||
startLiveQueryServer: true,
|
startLiveQueryServer: true,
|
||||||
|
__indexBuildCompletionCallbackForTests: promise => {
|
||||||
|
promise.then(() => {
|
||||||
|
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
||||||
|
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
|
||||||
|
parseServer.server.close(() => done());
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
|
||||||
expect(parseServer.liveQueryServer.server).toBe(parseServer.server);
|
|
||||||
parseServer.server.close(() => done());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can be initialized through ParseServer with liveQueryServerOptions', function(done) {
|
it('can be initialized through ParseServer with liveQueryServerOptions', function(done) {
|
||||||
@@ -178,12 +181,18 @@ describe('ParseLiveQueryServer', function() {
|
|||||||
liveQueryServerOptions: {
|
liveQueryServerOptions: {
|
||||||
port: 22347,
|
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());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(parseServer.liveQueryServer).not.toBeUndefined();
|
|
||||||
expect(parseServer.liveQueryServer.server).not.toBe(parseServer.server);
|
|
||||||
parseServer.liveQueryServer.server.close();
|
|
||||||
parseServer.server.close(() => done());
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -62,17 +62,20 @@ describe('Server Url Checks', () => {
|
|||||||
}
|
}
|
||||||
const newConfiguration = Object.assign({}, defaultConfiguration, {
|
const newConfiguration = Object.assign({}, defaultConfiguration, {
|
||||||
databaseAdapter,
|
databaseAdapter,
|
||||||
});
|
__indexBuildCompletionCallbackForTests: promise => {
|
||||||
const parseServer = ParseServer.start(newConfiguration, () => {
|
promise.then(() => {
|
||||||
parseServer.handleShutdown();
|
parseServer.handleShutdown();
|
||||||
parseServer.server.close(err => {
|
parseServer.server.close(err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
done.fail('Close Server Error');
|
done.fail('Close Server Error');
|
||||||
}
|
}
|
||||||
reconfigureServer({}).then(() => {
|
reconfigureServer({}).then(() => {
|
||||||
done();
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
});
|
});
|
||||||
|
const parseServer = ParseServer.start(newConfiguration);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -440,13 +440,20 @@ describe('SchemaController', () => {
|
|||||||
// If two callers race to create the same schema, the response to the
|
// If two callers race to create the same schema, the response to the
|
||||||
// race loser should be the same as if they hadn't been racing.
|
// race loser should be the same as if they hadn't been racing.
|
||||||
config.database.loadSchema().then(schema => {
|
config.database.loadSchema().then(schema => {
|
||||||
const p1 = schema.addClassIfNotExists('NewClass', {
|
const p1 = schema
|
||||||
foo: { type: 'String' },
|
.addClassIfNotExists('NewClass', {
|
||||||
});
|
foo: { type: 'String' },
|
||||||
const p2 = schema.addClassIfNotExists('NewClass', {
|
})
|
||||||
foo: { type: 'String' },
|
.then(validateSchema)
|
||||||
});
|
.catch(validateError);
|
||||||
Promise.race([p1, p2]).then(actualSchema => {
|
const p2 = schema
|
||||||
|
.addClassIfNotExists('NewClass', {
|
||||||
|
foo: { type: 'String' },
|
||||||
|
})
|
||||||
|
.then(validateSchema)
|
||||||
|
.catch(validateError);
|
||||||
|
let schemaValidated = false;
|
||||||
|
function validateSchema(actualSchema) {
|
||||||
const expectedSchema = {
|
const expectedSchema = {
|
||||||
className: 'NewClass',
|
className: 'NewClass',
|
||||||
fields: {
|
fields: {
|
||||||
@@ -467,10 +474,17 @@ describe('SchemaController', () => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
expect(dd(actualSchema, expectedSchema)).toEqual(undefined);
|
expect(dd(actualSchema, expectedSchema)).toEqual(undefined);
|
||||||
});
|
schemaValidated = true;
|
||||||
Promise.all([p1, p2]).catch(error => {
|
}
|
||||||
|
let errorValidated = false;
|
||||||
|
function validateError(error) {
|
||||||
expect(error.code).toEqual(Parse.Error.INVALID_CLASS_NAME);
|
expect(error.code).toEqual(Parse.Error.INVALID_CLASS_NAME);
|
||||||
expect(error.message).toEqual('Class NewClass already exists.');
|
expect(error.message).toEqual('Class NewClass already exists.');
|
||||||
|
errorValidated = true;
|
||||||
|
}
|
||||||
|
Promise.all([p1, p2]).then(() => {
|
||||||
|
expect(schemaValidated).toEqual(true);
|
||||||
|
expect(errorValidated).toEqual(true);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -97,11 +97,13 @@ class ParseServer {
|
|||||||
|
|
||||||
logging.setLogger(loggerController);
|
logging.setLogger(loggerController);
|
||||||
const dbInitPromise = databaseController.performInitialization();
|
const dbInitPromise = databaseController.performInitialization();
|
||||||
hooksController.load();
|
const hooksLoadPromise = hooksController.load();
|
||||||
|
|
||||||
// Note: Tests will start to fail if any validation happens after this is called.
|
// Note: Tests will start to fail if any validation happens after this is called.
|
||||||
if (process.env.TESTING) {
|
if (process.env.TESTING) {
|
||||||
__indexBuildCompletionCallbackForTests(dbInitPromise);
|
__indexBuildCompletionCallbackForTests(
|
||||||
|
Promise.all([dbInitPromise, hooksLoadPromise])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cloud) {
|
if (cloud) {
|
||||||
|
|||||||
Reference in New Issue
Block a user