- Create ingest-api with Koa framework for handling device telemetry. - Implement telemetry ingestion with MongoDB, Redis, and PostgreSQL. - Add API endpoints for telemetry and health checks. - Set up testing with Vitest for unit and end-to-end tests. - Configure Prettier and ESLint for code formatting and linting. - Create Docker Compose setup for PostgreSQL, MongoDB, and Redis services. - Establish contracts package for shared Zod schemas and TypeScript types. - Implement React frontend with device status and greeting functionalities. - Add VS Code setup documentation for onboarding developers.
19 lines
468 B
TypeScript
19 lines
468 B
TypeScript
import request from 'supertest';
|
|
import { createApp } from '../src/app.js';
|
|
import { createMemoryWriter } from '../src/stores.js';
|
|
|
|
describe('ingest-api (e2e)', () => {
|
|
const app = createApp(createMemoryWriter());
|
|
|
|
it('POST /telemetry', async () => {
|
|
await request(app.callback())
|
|
.post('/telemetry')
|
|
.send({
|
|
deviceId: 'dev-1',
|
|
sentAt: new Date().toISOString(),
|
|
payload: { temp: 21 },
|
|
})
|
|
.expect(200);
|
|
});
|
|
});
|