feat: add Makelore Robot hardware module
This commit is contained in:
19
tests/unit/ai-hardware-server-registration.test.ts
Normal file
19
tests/unit/ai-hardware-server-registration.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user