Skip to content

Commit c594622

Browse files
committed
test(daemon): answer the ownership facts seam in the recovery fixture
1 parent 64f73d4 commit c594622

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎src/daemon/__tests__/request-router-open.test.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ import { replayScriptSourceBundleFor } from '../../__tests__/test-utils/replay-s
1111
vi.mock('../device-ready.ts', () => ({ ensureDeviceReady: vi.fn(async () => {}) }));
1212
vi.mock('@agent-device/host-kit/process', async (importOriginal) => {
1313
const actual = await importOriginal<typeof import('@agent-device/host-kit/process')>();
14-
return { ...actual, readProcessStartTime: vi.fn(() => 'test-process-start') };
14+
const startTime = 'test-process-start';
15+
return {
16+
...actual,
17+
readProcessStartTime: vi.fn(() => startTime),
18+
// The ownership decision reads all three facts in one call, so it has to answer with the
19+
// same fabricated start time this fixture writes into its markers.
20+
readProcessIdentityFacts: vi.fn(async (pid: number) => ({
21+
startTime,
22+
command: actual.readProcessCommand(pid),
23+
zombie: false,
24+
})),
25+
};
1526
});
1627
vi.mock('@agent-device/platform-apple/runner/operations', async (importOriginal) => {
1728
const actual =

0 commit comments

Comments
 (0)