import { describe, it, expect, beforeAll, afterAll } from 'vitest'; import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { createApp } from '../../app.js'; import { initDb } from '../../db/index.js'; // CLIENT_DIST relocates the built dashboard for embedders (the desktop app // ships client/dist in extraResources, out of reach of the default // __dirname-relative path). describe('CLIENT_DIST override', () => { let tmpDir: string; beforeAll(() => { process.env.ENCRYPTION_KEY = '0'.repeat(64); initDb(':memory:'); tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'freeapi-client-dist-')); fs.writeFileSync(path.join(tmpDir, 'index.html'), '