Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update vitest version #15687

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('protocol storage directory utilities', () => {
describe('addProtocolFile', () => {
it('writes a protocol file to a new directory', () => {
let count = 0
vi.mocked(uuid).mockImplementation(() => {
vi.mocked(uuid).mockImplementation((): any => {
const nextId = `${count}abc123`
count = count + 1
return nextId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('release manifest utilities', () => {
const manifestUrl = 'http://example.com/releases.json'

vi.mocked(Http.fetchJson).mockImplementation(
(url: unknown): Promise<unknown> => {
(url: unknown): Promise<any> => {
if (url === manifestUrl) return Promise.resolve(result)
return Promise.resolve()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('DownloadUpdateModal', () => {
progressPercent: 50,
})
vi.mocked(getRobotSessionIsManualFile).mockReturnValue(false)
vi.mocked(useDispatchStartRobotUpdate).mockReturnValue(vi.fn)
vi.mocked(useDispatchStartRobotUpdate).mockReturnValue(vi.fn())
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 @@ -150,8 +150,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.4.1",
"wait-on": "^4.0.2",
"webpack": "^4.41.6",
"webpack-bundle-analyzer": "^3.6.0",
Expand Down
4 changes: 2 additions & 2 deletions protocol-designer/src/__tests__/persist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ 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
let setItemSpy: MockInstance

beforeEach(() => {
const LocalStorageProto = Object.getPrototypeOf(global.localStorage)
Expand Down
4 changes: 4 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default mergeConfig(
allowOnly: true,
exclude: [...configDefaults.exclude, '**/node_modules/**', '**/dist/**'],
setupFiles: ['./setup-vitest.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
},
},
resolve: {
alias: {
Expand Down
Loading
Loading