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; }>; const mobileUAString = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Mobile Safari/537.36'; function initTestStaticFiles(staticPath: string) { const files = { 'selfhost.html': `AFFiNE