Files
core2026/app/game-api/test/streamKeys.test.ts
T
Hide_D 1688ca0d23 feat: implement game API with TRPC and Redis transport
- Added GameApiConfig interface and configuration resolver from environment variables.
- Created GameApiContext for managing database and transport dependencies.
- Implemented InMemoryTurnDaemonTransport for testing purposes.
- Developed RedisTurnDaemonTransport for command and status handling via Redis streams.
- Defined TurnDaemonStreamKeys for namespacing Redis streams by profile.
- Established TRPC router with endpoints for health check, world state retrieval, and turn daemon commands (run, pause, resume, status).
- Integrated Fastify server with TRPC and Redis transport.
- Added unit tests for router functionality and stream key generation.
- Configured Vitest for testing environment.
2025-12-30 01:04:52 +00:00

12 lines
453 B
TypeScript

import { describe, expect, it } from 'vitest';
import { buildTurnDaemonStreamKeys } from '../src/daemon/streamKeys.js';
describe('buildTurnDaemonStreamKeys', () => {
it('namespaces streams by profile', () => {
const keys = buildTurnDaemonStreamKeys('che:default');
expect(keys.commandStream).toBe('sammo:che:default:turn-daemon:commands');
expect(keys.eventStream).toBe('sammo:che:default:turn-daemon:events');
});
});