feat: add run-server script to manage server execution and compatibility checks feat: create main application logic for desktop with window management, server handling, and auto-updater test: add unit tests for desktop runtime helpers feat: implement desktop server environment configuration and health check test: add tests for server configuration and desktop routes feat: add native module guard for better-sqlite3 compatibility test: add tests for native module guard functionality test: add comprehensive tests for account verification feedback handling feat: implement account verification feedback helpers chore: add TypeScript configuration for desktop builds
25 lines
751 B
TypeScript
25 lines
751 B
TypeScript
import Fastify from 'fastify';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { isPublicApiRoute, registerDesktopRoutes } from './desktop.js';
|
|
|
|
describe('desktop server routes', () => {
|
|
it('marks only the desktop health route as public', () => {
|
|
expect(isPublicApiRoute('/api/desktop/health')).toBe(true);
|
|
expect(isPublicApiRoute('/api/stats/dashboard')).toBe(false);
|
|
});
|
|
|
|
it('registers a public desktop health probe', async () => {
|
|
const app = Fastify();
|
|
await registerDesktopRoutes(app);
|
|
|
|
const response = await app.inject({
|
|
method: 'GET',
|
|
url: '/api/desktop/health',
|
|
});
|
|
|
|
expect(response.statusCode).toBe(200);
|
|
expect(response.json()).toEqual({ ok: true });
|
|
await app.close();
|
|
});
|
|
});
|