import { mkdirSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import type { INestApplication } from '@nestjs/common'; import { PrismaClient } from '@prisma/client'; import type { TestFn } from 'ava'; import ava from 'ava'; import request from 'supertest'; import { buildAppModule } from '../../src/app.module'; import { ServerService } from '../../src/core/config'; import { Config } from '../../src/fundamentals'; import { createTestingApp, initTestingDB } from '../utils'; const test = ava as TestFn<{ app: INestApplication; db: PrismaClient; }>; function initTestStaticFiles(staticPath: string) { const files = { 'selfhost/index.html': `AFFiNE