-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to import modules inside imported module from tests #137
Comments
please create a minimal repo which reproduces this issue |
There you go : https://github.com/wilomgfx/ts-jest-import-issue-repo As soon as i import a module from npm (in this case react-native-i18n just like in my real app) it won't import it properly causing an undefined error. |
@wilomgfx the import is incorrect. Use import * as I18n from 'react-native-i18n'; I've sent a PR to your repo. |
Oh waow, thanks! Indeed. Kinda strange that it worked even if i was not importing everything from the said package when building up for the app. Thanks a lot :P Any idea why ? |
In case anyone else comes here and ends up seeing
Check out microsoft/TypeScript#5073 tl;dr add |
When ever i link a module from my typescript source files, it seems like the modules inside that said imported module are not imported.
Heres an example test
My config
To make it work i have to import my compiled javascript from my build folder
Heres the imported file that is causing the error when referencing the typescript file from the src folder
Work ? I dont know, maybe my configs are wrong... but it wont work for required typescript files.
Tried to use an other file with some other random imported file, and it wont work either.
The text was updated successfully, but these errors were encountered: