title: Mock array of objects using Jest
body: <p>I am trying to write a unit test with Jest for a service in angular app and I have a question about how to mock a data. As part of my mock data I need to mock <code>Array&lt;App&gt;</code> which has an interface like this </p>
  
  <pre><code>    interface App  {
          Color: string;
          Id: string;
          Size: TileSize;
          Text: string;
          Title: string;
          Url: string;
      }
  
  so I tried to mock the data like this in my test file:
  const Apps: Array&lt;App&gt; = [
          {
              'Id': 'Chat',
              'Text': 'Chat',
              'Title': 'Go to your chat',
              'Url': 'https://chat.com'
          },
          {
              'Id': 'Mail',
              'Text': 'Mail',
              'Title': 'Go to your Mail',
              'Url': 'https://mail.com'
          }
      ];
  
  MockConfigParserService.mockImplementation(() =&gt; {
          return {
              parse: () =&gt; {
                  return {
                      workloads
                  };
              }
          };
      });
  </code></pre>
  
  <p>My test fails running the service that I am testing by throwing this error </p>
  
  <pre><code> Unhandled Promise rejection: workloads.slice is not a function ; Zone: ProxyZone ; Task: Promise.then ; Value: TypeError: workloads.slice is not a function
  </code></pre>
  
  <p>at this line of code in service code (the service works fine outside of test): <code>return this.appsPromise.then(apps =&gt; [...apps]);</code></p>
  
  <p>how should I change mock data for array of apps so it doesn't throw this error?
  Thanks a lot in davance</p>