NativeScript / nativescript-angular

Integrating NativeScript with Angular
http://docs.nativescript.org/angular/tutorial/ng-chapter-0
Apache License 2.0
1.22k stars 241 forks source link

Jest support for NativeScript + Angular. #2329

Open james-spears opened 3 years ago

james-spears commented 3 years ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when I try to unit test my NativeScript + Angular application using Jest. **Describe the solution you'd like**

I would appreciate support for using Jest with NativeScript + Angular.

Describe alternatives you've considered

Please see this stackoverflow question, where I outline my struggles. What is holding it back at the moment is transpilation of @nativescript/core and @nativescript/angular prior to running the tests. There are some import statements which Jest does not like, and when I follow the instructions from Jest and instruct ts-jest or babel-jest to transpile, I get another error about not being able to find ./application, or ~package.json.

Additional context

With guidance I would be willing to continue working the problem and search for a solution. Or some comments and/or responses to my stackoverflow question would be greatly appreciated, even if it is to comment on why it cannot easily be done. Thank you.

wSedlacek commented 3 years ago

@jameone This might be a useful reference - https://github.com/nstudio/xplat/issues/170#issuecomment-574898977