-
Notifications
You must be signed in to change notification settings - Fork 194
Expand file tree
/
Copy pathsetup-vitest.mts
More file actions
31 lines (27 loc) · 888 Bytes
/
setup-vitest.mts
File metadata and controls
31 lines (27 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import '@testing-library/jest-dom/vitest'
import { cleanup } from '@testing-library/react'
import { afterEach, vi } from 'vitest'
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')
vi.mock('./app/src/resources/useNotifyDataReady', async () => {
const actual = await vi.importActual('./app/src/resources/useNotifyDataReady')
return {
...actual,
useNotifyDataReady: () => ({
notifyOnSettled: vi.fn(),
isNotifyEnabled: true,
}),
}
})
global._OT_PD_VERSION_ = 'fake_PD_version'
global._OT_PD_REQUIRED_APP_VERSION_ = 'fake_app_version'
global._PKG_VERSION_ = 'test environment'
global._OPENTRONS_PROJECT_ = 'robotics'
global._PKG_PRODUCT_NAME_ = 'test product'
global._PKG_BUGS_URL_ = 'http://bugs.contoso.com'
afterEach(() => {
cleanup()
})