Skip to content

Commit

Permalink
prepare test case for #1700
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Dec 7, 2023
1 parent f212295 commit 66e3283
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/typescript/custom-types/i18next.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ declare module 'i18next' {
foo_many: 'foo';
foo_other: 'foo';
};
nonPlurals: {
test: 'Test';
test_2: 'Test 2';
// 'test_form.title': 'title';
test_form: {
title: 'title';
};
};
ctx: {
foo: 'foo';
dessert_cake: 'a nice cake';
Expand Down
7 changes: 7 additions & 0 deletions test/typescript/custom-types/t.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ function i18nextOrdinalPluralUsage(t: TFunction<'ord'>) {
t('place', { ordinal: true, count: 4 }).trim();
}

function i18nextTFalsePluralsUsage(t: TFunction<'nonPlurals'>) {
// this currently errors, but should not...
// t('test').trim();
t('test_2').trim();
t('test_form.title').trim();
}

// @ts-expect-error
function returnNeverWithInvalidNamespace(t: TFunction<string>) {
const result: never = t('foo');
Expand Down

0 comments on commit 66e3283

Please sign in to comment.