Simple Typescript Stubs
In my previous post, Angular Component Class Tests, I shared why I prefer to write my Angular unit tests exclusively as component class tests. In this post, I want to share a simple function I use to create typed stubs.
In my previous post, you’ll notice I had to cast my dependencies to the Typescript
any type in order to inject them into the constructor. Here’s that example again: