diff --git a/app/src/resources/__tests__/useNotifyService.test.ts b/app/src/resources/__tests__/useNotifyService.test.ts index b1e6689cc39..ad8628e3e87 100644 --- a/app/src/resources/__tests__/useNotifyService.test.ts +++ b/app/src/resources/__tests__/useNotifyService.test.ts @@ -138,7 +138,9 @@ describe('useNotifyService', () => { }) it('should return set HTTP refetch to always and fire an analytics reporting event if the connection was refused', () => { - vi.mocked(appShellListener).mockImplementation(function ({ callback }): any { + vi.mocked(appShellListener).mockImplementation(function ({ + callback, + }): any { // eslint-disable-next-line n/no-callback-literal callback('ECONNREFUSED') }) @@ -155,9 +157,11 @@ describe('useNotifyService', () => { }) it('should trigger a single HTTP refetch if the refetch flag was returned', () => { - vi.mocked(appShellListener).mockImplementation(function ({ callback }): any { + vi.mocked(appShellListener).mockImplementation(function ({ + callback, + }): any { // eslint-disable-next-line n/no-callback-literal - callback('ECONNREFUSED') + callback({ refetchUsingHTTP: true }) }) const { rerender } = renderHook(() => useNotifyService({ @@ -171,9 +175,11 @@ describe('useNotifyService', () => { }) it('should trigger a single HTTP refetch if the unsubscribe flag was returned', () => { - vi.mocked(appShellListener).mockImplementation(function ({ callback }): any { + vi.mocked(appShellListener).mockImplementation(function ({ + callback, + }): any { // eslint-disable-next-line n/no-callback-literal - callback('ECONNREFUSED') + callback({ unsubscribe: true }) }) const { rerender } = renderHook(() => useNotifyService({ diff --git a/setup-vitest.ts b/setup-vitest.ts index c4baaaf3bb6..07bd135137d 100644 --- a/setup-vitest.ts +++ b/setup-vitest.ts @@ -6,6 +6,7 @@ vi.mock('protocol-designer/src/labware-defs/utils') vi.mock('electron-store') vi.mock('electron-updater') vi.mock('electron') +vi.mock('./app/src/redux/shell/remote') process.env.OT_PD_VERSION = 'fake_PD_version' global._PKG_VERSION_ = 'test environment'