diff --git a/test/typescript/custom-types/t.test.ts b/test/typescript/custom-types/t.test.ts index 9a7ce725..c01fc0d6 100644 --- a/test/typescript/custom-types/t.test.ts +++ b/test/typescript/custom-types/t.test.ts @@ -154,6 +154,12 @@ describe('t', () => { assertType(t('foo', { context: 'cake' })); }); + it('should accept not mapped context if a fallback key is present', () => { + // wine is not mapped + const currentTheme = 'wine' as 'wine' | 'beer' | 'water'; + expectTypeOf(t('beverage', { context: currentTheme })).toMatchTypeOf(); + }); + it('should accept a default context key as a valid `t` function key', () => { expectTypeOf(t('beverage')).toMatchTypeOf('cold water'); });