Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(update): mock updater spawn in updateService tests

guyongc14c1de6f97f
diff --git a/apps/desktop/src/main/__tests__/updateService.test.ts b/apps/desktop/src/main/__tests__/updateService.test.ts
index 52a6baaf44..41d0f3816e 100644
--- a/apps/desktop/src/main/__tests__/updateService.test.ts
+++ b/apps/desktop/src/main/__tests__/updateService.test.ts
@@ -123,6 +123,17 @@ vi.mock('../cindy-brain/index', () => ({
getGhostNodeRuntimeBroker: () => ({ destroyAll: vi.fn() }),
}));
+vi.mock('node:child_process', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('node:child_process')>();
+ return {
+ ...actual,
+ spawn: () => ({
+ unref: vi.fn(),
+ on: vi.fn(),
+ }),
+ };
+});
+
vi.mock('../security/trustedAppRenderer', () => ({
assertTrustedAppRendererEvent: vi.fn(),
}));