-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Cover default export type (#436)
- Loading branch information
1 parent
322b90e
commit e499b99
Showing
3 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
|
||
// Import all types to ensure they exist | ||
import NextI18Next, { | ||
AppWithTranslation, | ||
Config, | ||
I18n, | ||
InitConfig, | ||
TFunction, | ||
WithTranslation, | ||
} from '../types' | ||
|
||
const DummyComponent = () => <div /> | ||
|
||
const emptyConfig = { | ||
defaultLanguage: null, | ||
otherLanguages: [], | ||
} | ||
|
||
// Instantiate instance and call methods upon it | ||
const Instance = new NextI18Next(emptyConfig) | ||
Instance.appWithTranslation(DummyComponent) | ||
Instance.withTranslation('common')(DummyComponent) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,8 @@ | |
"noEmit": true, | ||
"lib": ["esnext", "dom"], | ||
"jsx": "react" | ||
} | ||
}, | ||
"include": [ | ||
"__tests__/types.test.tsx" | ||
] | ||
} |