Skip to content

Commit

Permalink
chore: update vitest and vitest-when
Browse files Browse the repository at this point in the history
update vitest and vitest-when

close AUTH-
  • Loading branch information
koji committed Dec 19, 2024
1 parent a56e919 commit 399c847
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ describe('DownloadUpdateModal', () => {

let props: React.ComponentProps<typeof RobotUpdateProgressModal>
const mockCreateLiveCommand = vi.fn()
const mockDispatchStartRobotUpdate = vi.fn()

beforeEach(() => {
mockCreateLiveCommand.mockResolvedValue(null)
Expand All @@ -68,7 +69,9 @@ describe('DownloadUpdateModal', () => {
progressPercent: 50,
})
vi.mocked(getRobotSessionIsManualFile).mockReturnValue(false)
vi.mocked(useDispatchStartRobotUpdate).mockReturnValue(vi.fn)
vi.mocked(useDispatchStartRobotUpdate).mockReturnValue(
mockDispatchStartRobotUpdate
)
vi.mocked(getRobotUpdateDownloadError).mockReturnValue(null)
})

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@vitejs/plugin-react": "4.2.0",
"@vitest/coverage-v8": "1.3.0",
"@vitest/coverage-v8": "2.0.1",
"ajv": "6.12.3",
"aws-sdk": "^2.493.0",
"babel-loader": "^8.2.2",
Expand Down Expand Up @@ -151,8 +151,8 @@
"typescript": "5.3.3",
"url-loader": "^2.1.0",
"vite": "5.3.2",
"vitest": "1.2.2",
"vitest-when": "0.3.1",
"vitest": "^2.0.1",
"vitest-when": "0.5.0",
"wait-on": "^4.0.2",
"webpack": "^4.41.6",
"webpack-bundle-analyzer": "^3.6.0",
Expand Down
11 changes: 8 additions & 3 deletions protocol-designer/src/__tests__/persist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ import type { MockInstance } from 'vitest'
import * as persist from '../persist'

describe('persist', () => {
let getItemSpy: MockInstance<unknown[], unknown>
let setItemSpy: MockInstance<unknown[], unknown>
// let getItemSpy: MockInstance<unknown[], unknown>
// let setItemSpy: MockInstance<unknown[], unknown>

let getItemSpy: MockInstance<(key: string) => string | null>
let setItemSpy: MockInstance<(key: string, value: string) => void>

beforeEach(() => {
const LocalStorageProto = Object.getPrototypeOf(global.localStorage)
getItemSpy = vi.spyOn(LocalStorageProto, 'getItem')
getItemSpy = vi.spyOn(LocalStorageProto, 'getItem') as MockInstance<
(key: string) => string | null
>
setItemSpy = vi.spyOn(LocalStorageProto, 'setItem')
})

Expand Down
Loading

0 comments on commit 399c847

Please sign in to comment.