title: Angular Unit Testing - stub complex object
body: <p>In my unit tests, I have to create stubs that have a large number of properties.</p>
  
  <p>So I would have an interface like this:</p>
  
  <pre><code>interface Person {
    id: string;
    name: string;
    age: number
    ...
  }
  </code></pre>
  
  <p>Then I will have to create an object that implements this interface and pass some values to each property.
  Doesn't Jasmine have a function that receives an interface and returns an object with default values?</p>
  
  <p>In the example above, I would get: </p>
  
  <pre><code>const stub: Person = createStubObj&lt;Person&gt;();
  stub.id // ""
  stub.name // ""
  stub.getAge // 0
  </code></pre>
  
  <p>I did some research but didn't found anything useful.</p>
  
  <p><strong>createSpyObj</strong> doesn't seem to help me because I don't have any functions that I want to spy on. The object only has properties.</p>
  
  <p>This case can happen when an HTTP request returns a complex object (many properties, nested properties). I'm wondering how can I mock that object in that case, without needing to specify a value for each property.</p>
  
  <p>Something similar to what this library is doing: <a href="https://www.npmjs.com/package/ts-auto-mock#usage" rel="nofollow noreferrer">https://www.npmjs.com/package/ts-auto-mock#usage</a></p>
  
  <p>I'm wondering if this can be achieved in Jasmine as well or if there is a better approach</p>