feat(coding): compose plugin host lifecycle
This commit is contained in:
@@ -16,4 +16,20 @@ describe('Data Service Host API registration', () => {
|
||||
expect(worksIndex).toBeGreaterThan(dataServiceIndex);
|
||||
expect(source).not.toContain('handleDataServiceRoute = handleDataServiceRoutes');
|
||||
});
|
||||
|
||||
it('registers project plugins in the shared coding dispatcher without replacing typed configuration', async () => {
|
||||
const source = await readFile(resolve('electron/api/route-handlers.ts'), 'utf8');
|
||||
expect(source).toMatch(
|
||||
/import\s+\{\s*handleCodingPluginRoutes\s*\}\s+from\s+['"]\.\/routes\/coding-plugins['"]/,
|
||||
);
|
||||
const routeList = source.match(/hostApiRouteHandlers[^=]*=\s*\[([\s\S]*?)\];/);
|
||||
const routes = routeList?.[1] ?? '';
|
||||
expect(routes.indexOf('handleCodingPluginRoutes')).toBeGreaterThan(
|
||||
routes.indexOf('handleCodingProjectRoutes'),
|
||||
);
|
||||
expect(routes.indexOf('handleCodingConversationRoutes')).toBeGreaterThan(
|
||||
routes.indexOf('handleCodingPluginRoutes'),
|
||||
);
|
||||
expect(routes.indexOf('handleDataServiceRoutes')).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user