title: Mocking in Typescript unit tests
body: <p>The problem is that mocking in Typescript can get tricky if the object is complex enough (well in any strongly-typed language). You would usually mock some extra stuff just to make code compile and in C# for instance, you can use AutoFixture or similar. On the other hand Javascript is dynamic language and it's possible to mock only part of the object that's needed for test to run.</p>
  
  <p>So in Typescript unit test I can declare my dependency using <code>any</code> type and thus  easily mock it. Do you see any drawbacks of such approach? </p>
  
  <pre><code>let userServiceMock: MyApp.Services.UserService = {
      // lots of thing to mock
  }
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>let userServiceMock: any = {
      user: {
           setting: {
               showAvatar: true
           }
      }
  }
  </code></pre>