Files
twenty/packages/twenty-server/test/integration/utils/setup-test.ts
T
Félix MalfaitandGitHub 30a2164980 First Application POC (#14382)
Quick proof of concept for twenty-apps + twenty-cli, with local
development / hot reload

Let's discuss it!



https://github.com/user-attachments/assets/c6789936-cd5f-4110-a265-863a6ac1af2d
2025-09-10 15:12:38 +02:00

26 lines
900 B
TypeScript

import { type JestConfigWithTsJest } from 'ts-jest';
import 'tsconfig-paths/register';
import { DataSeedWorkspaceCommand } from 'src/database/commands/data-seed-dev-workspace.command';
import { rawDataSource } from 'src/database/typeorm/raw/raw.datasource';
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
import { createApp } from './create-app';
export default async (_: unknown, projectConfig: JestConfigWithTsJest) => {
const app = await createApp({});
if (!projectConfig.globals) {
throw new Error('No globals found in project config');
}
await rawDataSource.initialize();
await app.listen(projectConfig.globals.APP_PORT as number);
global.app = app;
global.testDataSource = rawDataSource;
global.dataSourceService = app.get(DataSourceService);
global.dataSeedWorkspaceCommand = app.get(DataSeedWorkspaceCommand);
};