feat: add Makelore Robot hardware module

This commit is contained in:
2026-08-13 23:17:22 +08:00
parent 22add3f01f
commit aba5cae286
25 changed files with 3169 additions and 72 deletions

View File

@@ -0,0 +1,19 @@
import { readFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
describe('AI hardware Host API registration', () => {
it('registers the dedicated handler in the Host API route chain', async () => {
const source = await readFile(resolve('electron/api/server.ts'), 'utf8');
expect(source).toMatch(
/import\s+\{\s*handleAiHardwareRoutes\s*\}\s+from\s+['"]\.\/routes\/ai-hardware['"]/,
);
const routeList = source.match(
/const\s+coreRouteHandlers\s*:\s*RouteHandler\[\]\s*=\s*\[([\s\S]*?)\];/,
);
expect(routeList?.[1]).toBeDefined();
expect(routeList?.[1].match(/\bhandleAiHardwareRoutes\b/g)).toHaveLength(1);
});
});