Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-istanbul": "2.1.8",
"@vitest/coverage-istanbul": "3.0.4",
"browserslist": "4.24.4",
"builtin-modules": "4.0.0",
"cross-env": "7.0.3",
Expand All @@ -48,7 +48,7 @@
"tstyche": "3.5.0",
"typescript": "5.7.3",
"vite": "6.0.11",
"vitest": "2.1.8",
"vitest": "3.0.4",
"vitest-localstorage-mock": "0.1.2",
"wait-for-expect": "3.0.2"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/use-i18n/src/__tests__/usei18n.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { act, renderHook, waitFor } from '@testing-library/react'
import { enGB, fr as frDateFns } from 'date-fns/locale'
import { ErrorCode, FormatError } from 'intl-messageformat'
import mockdate from 'mockdate'
import type { ComponentProps, ReactNode } from 'react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
Expand Down Expand Up @@ -502,9 +503,12 @@ describe('i18n hook', () => {
)

expect(mockOnTranslateError).toHaveBeenCalledTimes(1)

expect(mockOnTranslateError).toHaveBeenCalledWith({
error: new Error(
error: new FormatError(
'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}"',
ErrorCode.MISSING_VALUE,
'onTranslateError fonction sera appelé car il manque une variable en français {oldFrenchVariable}',
),
defaultLocale: 'en',
currentLocale: 'fr',
Expand Down
Loading
Loading