Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/host-kit/src/internal/host-process-liveness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ function psInstalledAt(installed: readonly string[]): void {
}

beforeEach(() => {
const readFileSync = fs.readFileSync;
vi.spyOn(fs, 'readFileSync').mockImplementation((path, options) => {
if (String(path).startsWith('/proc/')) {
throw Object.assign(new Error('proc is unavailable in the ps fixture'), { code: 'ENOENT' });
}
return readFileSync(path, options);
});
mockRunCmdSync.mockReset();
mockRunCmd.mockReset();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export function createFakeStatusBarSimctl(

return {
script: (args): FakeAppleToolResponse => {
if (args[0] === 'simctl' && args[1] === 'list' && args[2] === 'devices' && args[3] === '-j') {
return JSON.stringify({ devices: { runtime: [{ udid, state: 'Booted' }] } });
}
const unexpected = (detail: string): FakeAppleToolResponse => ({
stderr: `unexpected status bar call: ${detail}`,
exitCode: 1,
Expand Down
Loading
Loading