I'm using Jest 24 with my Angular 8 app.
When a try to test a private function on a component, a TS2341 error is thrown. Something like :
error TS2341: Property 'myFunction' is private and only accessible within class 'MyClass'
Is there a way to ignore or fix that ?
I already find the "// @ts-ignore" solution, but it's so ugly !
Thanks all !
You can cast to any, but that's ugly, too:
(MyClass as any).myFunction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With