title: else path not taken in unit testing
body: <p>I am working on angular 6</p>
  
  <blockquote>
    <p>I don't have any  else statement in my below code.But I am unable to cover branches due to else path not taken .What I need to do to get 100% branch coverage in this case?</p>
  </blockquote>
  
  <pre><code> getHeaderDocumentList(documents: any) {
              if (documents) {
                  documents.result.docAttachment.forEach(element =&gt; {
                      this.headerdocumentdetails.push(element.DocumentUniqueID);
                  });
              }
          }
  </code></pre>