Skip to content

Commit ddbbc26

Browse files
committed
test: type l10n helper spec callback
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> (cherry picked from commit 4e37429) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 01cfabd commit ddbbc26

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/tests/testHelpers/l10n.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
*/
55

66
import { describe, expect, it } from 'vitest'
7+
78
import { createL10nMock, interpolateL10n } from './l10n.js'
89

10+
type TranslationParams = Record<string, unknown>
911

1012
describe('l10n test helper', () => {
1113
it('interpolates placeholders without dropping unknown tokens', () => {
@@ -26,7 +28,7 @@ describe('l10n test helper', () => {
2628

2729
it('allows overriding only the behavior a spec cares about', () => {
2830
const mock = createL10nMock({
29-
t: (_app, message, params) => `${interpolateL10n(message, params)}!`,
31+
t: (_app: string, message: string, params?: TranslationParams) => `${interpolateL10n(message, params)}!`,
3032
})
3133

3234
expect(mock.t('libresign', 'Signed by {name}', { name: 'Jane' })).toBe('Signed by Jane!')

0 commit comments

Comments
 (0)