tachybase_todo/packages/plugins/collection-manager/src/__tests__/index.ts
Junyi a1dc139cf4
feat(plugin-cm): add unique option for base fields (#745)
* feat(plugin-cm): add unique option for base fields

* refactor(plugin-cm): make sure unique constraint sync with field option

* fix(plugin-cm): fix sqlite unique field sync

* fix(plugin-cm): fix unique constraint sync logic

* refactor(plugin-cm): remove unique property for select components

* fix: previous

* fix: test error

Co-authored-by: chenos <chenlinxh@gmail.com>
2022-08-20 23:23:13 +08:00

21 lines
507 B
TypeScript

import PluginErrorHandler from '@nocobase/plugin-error-handler';
import PluginUiSchema from '@nocobase/plugin-ui-schema-storage';
import { mockServer } from '@nocobase/test';
import lodash from 'lodash';
import Plugin from '../';
export async function createApp(options = {}) {
const app = mockServer();
if (lodash.get(options, 'cleanDB', true)) {
await app.cleanDb();
}
app.plugin(PluginErrorHandler);
app.plugin(Plugin);
app.plugin(PluginUiSchema);
await app.load();
return app;
}