How can I test a shared components method with Angular 2 unit testing? I need to test whether a shared components method has been called or not.
You can use spyOn or createSpy . About the difference between them: https://stackoverflow.com/a/45074442/5709697
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.