EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

Cannot find module './src/localize' when using localize, or LocalizePipe in e2e testing #45

Closed kamok closed 6 years ago

kamok commented 6 years ago

My TypeScript compiler keeps asking for ./src/localize, regardless if I use LocalizePipe or localize function in my e2e. Any ideas? Other packages I require from node_modules works fine.

ts compiler also doesn't throw any error on the editor until when I run the e2e suite.

I'm guessing this is because the e2e tests don't load the NativeScriptLocalizeModule normally done on the @NgModule. Is there a workaround?

lfabreges commented 6 years ago

No, there is no workaround, only your app can use the localize function or L pipe as it uses the iOS or Android API and resources. You will have to use the translated text in your test or override the localize function to not translate the text and just return the key when testing.