You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: overview/typescript.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,24 @@ We provide a few options that can improve TypeScript for `i18next`. All options
124
124
| interpolationSuffix | '\}}' | Suffix for interpolation |
125
125
| strictKeyChecks | false | Flag that enables strict key checking even if a `defaultValue` has been provided. This ensures all calls of `t` function don't accidentally use implicitly missing keys. |
126
126
127
+
## Testing
128
+
129
+
### Mocking the selector function
130
+
131
+
For testing purposes, you might find yourself wanting to mock the `t` function.
132
+
133
+
`i18next` exports a function called `keyFromSelector` to make this easier. Here's an example of how you can use it:
0 commit comments