Skip to content

Commit 460b070

Browse files
fix(deps): update vitest monorepo to v3 (major) (#2408)
* fix(deps): update vitest monorepo to v3 * fix: error code --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alexandre Philibeaux <[email protected]>
1 parent 761b131 commit 460b070

File tree

3 files changed

+129
-396
lines changed

3 files changed

+129
-396
lines changed

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@types/react": "19.0.8",
3333
"@types/react-dom": "19.0.3",
3434
"@vitejs/plugin-react": "4.3.4",
35-
"@vitest/coverage-istanbul": "2.1.8",
35+
"@vitest/coverage-istanbul": "3.0.4",
3636
"browserslist": "4.24.4",
3737
"builtin-modules": "4.0.0",
3838
"cross-env": "7.0.3",
@@ -48,7 +48,7 @@
4848
"tstyche": "3.5.0",
4949
"typescript": "5.7.3",
5050
"vite": "6.0.11",
51-
"vitest": "2.1.8",
51+
"vitest": "3.0.4",
5252
"vitest-localstorage-mock": "0.1.2",
5353
"wait-for-expect": "3.0.2"
5454
},

Diff for: packages/use-i18n/src/__tests__/usei18n.test.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { act, renderHook, waitFor } from '@testing-library/react'
22
import { enGB, fr as frDateFns } from 'date-fns/locale'
3+
import { ErrorCode, FormatError } from 'intl-messageformat'
34
import mockdate from 'mockdate'
45
import type { ComponentProps, ReactNode } from 'react'
56
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
@@ -502,9 +503,12 @@ describe('i18n hook', () => {
502503
)
503504

504505
expect(mockOnTranslateError).toHaveBeenCalledTimes(1)
506+
505507
expect(mockOnTranslateError).toHaveBeenCalledWith({
506-
error: new Error(
508+
error: new FormatError(
507509
'The intl string context variable "oldFrenchVariable" was not provided to the string "onTranslateError fonction sera appelé car il manque une variable en français {oldFrenchVariable}"',
510+
ErrorCode.MISSING_VALUE,
511+
'onTranslateError fonction sera appelé car il manque une variable en français {oldFrenchVariable}',
508512
),
509513
defaultLocale: 'en',
510514
currentLocale: 'fr',

0 commit comments

Comments
 (0)