Allow single server instance in test suite (#7262)

* initial pass

* reconfigureServer when needed

* finish postgres tests

* mongo tests

* more tests

* clean up

* re-add skipped test

* Fix transaction tests

* handle batch

* AuthenticationAdapter fix

* More reconfiguration

* clean up

* properly terminate cli servers

* handle Parse.Push

* Flaky PushController

* ensure reconfigureServer when changed

* fix postgres tests

* remove console.log

* LiveQuery spec remove duplicates and listeners
This commit is contained in:
Diamond Lewis
2021-03-13 09:05:22 -06:00
committed by GitHub
parent 8b0e8cd02c
commit 9563793303
36 changed files with 941 additions and 1020 deletions

View File

@@ -3,7 +3,6 @@
const Config = require('../lib/Config');
const SchemaController = require('../lib/Controllers/SchemaController');
const dd = require('deep-diff');
const TestUtils = require('../lib/TestUtils');
let config;
@@ -27,8 +26,6 @@ describe('SchemaController', () => {
afterEach(async () => {
await config.database.schemaCache.clear();
await TestUtils.destroyAllDataPermanently(false);
await config.database.adapter.performInitialization({ VolatileClassesSchemas: [] });
});
it('can validate one object', done => {
@@ -854,7 +851,8 @@ describe('SchemaController', () => {
});
});
it('creates non-custom classes which include relation field', done => {
it('creates non-custom classes which include relation field', async done => {
await reconfigureServer();
config.database
.loadSchema()
//as `_Role` is always created by default, we only get it here
@@ -1313,7 +1311,8 @@ describe('SchemaController', () => {
);
});
it('properly handles volatile _Schemas', done => {
it('properly handles volatile _Schemas', async done => {
await reconfigureServer();
function validateSchemaStructure(schema) {
expect(Object.prototype.hasOwnProperty.call(schema, 'className')).toBe(true);
expect(Object.prototype.hasOwnProperty.call(schema, 'fields')).toBe(true);