mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
set TEST_CLEAN_DATABASE when running server tests (#806)
After adding a batch of new server tests, some interactions between tests have shown up via a shared database. This sets an existing flag for dealing with this problem, that is used during browser tests but hadn't been needed before for server tests.
This commit is contained in:
@@ -5,6 +5,7 @@ import {HomeDBManager} from 'app/gen-server/lib/HomeDBManager';
|
||||
import {Permissions} from 'app/gen-server/lib/Permissions';
|
||||
import {assert} from 'chai';
|
||||
import {addSeedData, createInitialDb, removeConnection, setUpDB} from 'test/gen-server/seed';
|
||||
import {EnvironmentSnapshot} from 'test/server/testUtils';
|
||||
|
||||
import {Initial1536634251710 as Initial} from 'app/gen-server/migration/1536634251710-Initial';
|
||||
import {Login1539031763952 as Login} from 'app/gen-server/migration/1539031763952-Login';
|
||||
@@ -63,11 +64,19 @@ function assertMembersGroup(org: Organization, exists: boolean) {
|
||||
}
|
||||
|
||||
describe('migrations', function() {
|
||||
let oldEnv: EnvironmentSnapshot;
|
||||
|
||||
before(function() {
|
||||
oldEnv = new EnvironmentSnapshot();
|
||||
// This test is incompatible with TEST_CLEAN_DATABASE.
|
||||
delete process.env.TEST_CLEAN_DATABASE;
|
||||
setUpDB(this);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
oldEnv.restore();
|
||||
});
|
||||
|
||||
beforeEach(async function() {
|
||||
await home.connect();
|
||||
await createInitialDb(home.connection, false);
|
||||
|
||||
Reference in New Issue
Block a user