diff --git a/desktop/app/src/utils/IOSBridge.tsx b/desktop/app/src/utils/IOSBridge.tsx index 940625c24..9b9f417d7 100644 --- a/desktop/app/src/utils/IOSBridge.tsx +++ b/desktop/app/src/utils/IOSBridge.tsx @@ -65,8 +65,11 @@ function xcrunStartLogListener(udid: string) { ); } -export async function makeIOSBridge(idbPath: string): Promise { - if (await isAvailable(idbPath)) { +export async function makeIOSBridge( + idbPath: string, + isAvailableFn: (idbPath: string) => Promise = isAvailable, +): Promise { + if (await isAvailableFn(idbPath)) { return { startLogListener: idbStartLogListener.bind(null, idbPath), }; diff --git a/desktop/app/src/utils/__tests__/IOSBridge.node.tsx b/desktop/app/src/utils/__tests__/IOSBridge.node.tsx index 1cb516a01..6ec2420b6 100644 --- a/desktop/app/src/utils/__tests__/IOSBridge.node.tsx +++ b/desktop/app/src/utils/__tests__/IOSBridge.node.tsx @@ -38,7 +38,7 @@ test('uses xcrun with no idb', async () => { }); test('uses idb when present', async () => { - const ib = await makeIOSBridge('/usr/local/bin/idb'); + const ib = await makeIOSBridge('/usr/local/bin/idb', async (_) => true); ib.startLogListener('deadbeef'); expect(spawn).toHaveBeenCalledWith(