diff --git a/patches/jest-snapshot+28.1.3.patch b/patches/jest-snapshot+28.1.3.patch index d11a4e4c..a612f0f8 100644 --- a/patches/jest-snapshot+28.1.3.patch +++ b/patches/jest-snapshot+28.1.3.patch @@ -29,4 +29,4 @@ index a3d3b05..69f0132 100644 + const keys = [ ['resolveSnapshotPath', 'function'], - ['resolveTestPath', 'function'], + ['resolveTestPath', 'function'], \ No newline at end of file diff --git a/src/expo/__tests__/bundler.test.ts b/src/expo/__tests__/bundler.test.ts index 929a2e02..e910f515 100644 --- a/src/expo/__tests__/bundler.test.ts +++ b/src/expo/__tests__/bundler.test.ts @@ -1,11 +1,10 @@ import { expect } from 'chai'; import { mockDevice } from '../../__tests__/utils/debugging'; -import { stubFetch, withFetchError, withFetchResponse } from '../../__tests__/utils/fetch'; +import { stubFetch } from '../../__tests__/utils/fetch'; import { type InspectableDevice, fetchDevicesToInspect, - fetchDevicesToInspectFromUnknownWorkflow, findDeviceByName, inferDevicePlatform, } from '../bundler'; @@ -59,54 +58,6 @@ describe('fetchDevicesToInspect', () => { }); }); -describe('fetchDevicesToInspectFromUnknownWorkflow', () => { - it('fetches devices from modern and classic bundler addresses', async () => { - using fetch = stubFetch(); - - await fetchDevicesToInspectFromUnknownWorkflow({ host }); - - expect(fetch).to.be.calledWith(`http://${host}:19000/json/list`); - expect(fetch).to.be.calledWith(`http://${host}:8081/json/list`); - }); - - it('returns devices from modern bundler address', async () => { - const device = mockDevice({ deviceName: 'iPhone 7 Pro' }); - using fetch = stubFetch(); - - withFetchError(fetch.withArgs(`http://${host}:19000/json/list`)); - withFetchResponse(fetch.withArgs(`http://${host}:8081/json/list`), [device]); - - const devices = await fetchDevicesToInspectFromUnknownWorkflow({ host }); - - expect(devices).to.deep.equal([device]); - }); - - it('returns devices from classic bundler address', async () => { - const device = mockDevice({ deviceName: 'Pixel 7 Pro' }); - using fetch = stubFetch(); - - withFetchResponse(fetch.withArgs(`http://${host}:19000/json/list`), [device]); - withFetchError(fetch.withArgs(`http://${host}:8081/json/list`)); - - const devices = await fetchDevicesToInspectFromUnknownWorkflow({ host }); - - expect(devices).to.deep.equal([device]); - }); - - it('prioritizes modern bundler address', async () => { - const iphone = mockDevice({ deviceName: 'iPhone 15 Pro' }); - const android = mockDevice({ deviceName: 'Pixel 7 Pro' }); - using fetch = stubFetch(); - - withFetchResponse(fetch.withArgs(`http://${host}:19000/json/list`), [iphone]); - withFetchResponse(fetch.withArgs(`http://${host}:8081/json/list`), [android]); - - const devices = await fetchDevicesToInspectFromUnknownWorkflow({ host }); - - expect(devices).to.deep.equal([android]); - }); -}); - describe('findDeviceByName', () => { it('returns first device by its name', () => { const target = mockDevice({ deviceName: 'iPhone 15 Pro', id: 'page1' }); diff --git a/src/expoDebuggers.ts b/src/expoDebuggers.ts index 1a475a14..b588412c 100644 --- a/src/expoDebuggers.ts +++ b/src/expoDebuggers.ts @@ -1,12 +1,7 @@ import fs from 'fs'; import vscode from 'vscode'; -import { - fetchDevicesToInspect, - askDeviceByName, - inferDevicePlatform, - fetchDevicesToInspectFromUnknownWorkflow, -} from './expo/bundler'; +import { fetchDevicesToInspect, askDeviceByName, inferDevicePlatform } from './expo/bundler'; import { ExpoProjectCache, ExpoProject,