mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
create table test
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
global.DBGATE_TOOLS = require('dbgate-tools');
|
||||
const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver');
|
||||
const crypto = require('crypto');
|
||||
const fp = require('lodash/fp');
|
||||
|
||||
function randomDbName() {
|
||||
const generatedKey = crypto.randomBytes(6);
|
||||
@@ -55,9 +56,22 @@ const testWrapper = body => async (label, ...other) => {
|
||||
}
|
||||
};
|
||||
|
||||
function pickImportantTableInfo(table) {
|
||||
return {
|
||||
pureName: table.pureName,
|
||||
columns: table.columns.map(fp.pick(['columnName', 'notNull', 'autoIncrement'])),
|
||||
};
|
||||
}
|
||||
|
||||
function checkTableStructure(t1, t2) {
|
||||
// expect(t1.pureName).toEqual(t2.pureName)
|
||||
expect(pickImportantTableInfo(t1)).toEqual(pickImportantTableInfo(t2));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
randomDbName,
|
||||
connect,
|
||||
extractConnection,
|
||||
testWrapper,
|
||||
checkTableStructure,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user