mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 17:26:01 +00:00
SYNC: fixed test
This commit is contained in:
@@ -28,12 +28,14 @@ describe('Schema tests', () => {
|
|||||||
const count = schemas1.length;
|
const count = schemas1.length;
|
||||||
expect(structure1.tables.length).toEqual(2);
|
expect(structure1.tables.length).toEqual(2);
|
||||||
await runCommandOnDriver(conn, driver, dmp => dmp.createSchema('myschema'));
|
await runCommandOnDriver(conn, driver, dmp => dmp.createSchema('myschema'));
|
||||||
const structure2 = await driver.analyseIncremental(conn, structure1);
|
if (!engine.skipIncrementalAnalysis) {
|
||||||
const schemas2 = await driver.listSchemas(conn);
|
const structure2 = await driver.analyseIncremental(conn, structure1);
|
||||||
expect(schemas2.find(x => x.schemaName == 'myschema')).toBeTruthy();
|
const schemas2 = await driver.listSchemas(conn);
|
||||||
expect(schemas2.length).toEqual(count + 1);
|
expect(schemas2.find(x => x.schemaName == 'myschema')).toBeTruthy();
|
||||||
expect(schemas2.find(x => x.isDefault).schemaName).toEqual(engine.defaultSchemaName);
|
expect(schemas2.length).toEqual(count + 1);
|
||||||
expect(structure2).toBeNull();
|
expect(schemas2.find(x => x.isDefault).schemaName).toEqual(engine.defaultSchemaName);
|
||||||
|
expect(structure2).toBeNull();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -48,10 +50,12 @@ describe('Schema tests', () => {
|
|||||||
expect(schemas1.find(x => x.schemaName == 'myschema')).toBeTruthy();
|
expect(schemas1.find(x => x.schemaName == 'myschema')).toBeTruthy();
|
||||||
expect(structure1.tables.length).toEqual(2);
|
expect(structure1.tables.length).toEqual(2);
|
||||||
await runCommandOnDriver(conn, driver, dmp => dmp.dropSchema('myschema'));
|
await runCommandOnDriver(conn, driver, dmp => dmp.dropSchema('myschema'));
|
||||||
const structure2 = await driver.analyseIncremental(conn, structure1);
|
if (!engine.skipIncrementalAnalysis) {
|
||||||
const schemas2 = await driver.listSchemas(conn);
|
const structure2 = await driver.analyseIncremental(conn, structure1);
|
||||||
expect(schemas2.find(x => x.schemaName == 'myschema')).toBeFalsy();
|
const schemas2 = await driver.listSchemas(conn);
|
||||||
expect(structure2).toBeNull();
|
expect(schemas2.find(x => x.schemaName == 'myschema')).toBeFalsy();
|
||||||
|
expect(structure2).toBeNull();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user