1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

else path not taken in unit testing

Discussão em 'Angular' iniciado por Ramesh Rajendran, Julho 24, 2025.

  1. I am working on angular 6


    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?
    ​

    getHeaderDocumentList(documents: any) {
    if (documents) {
    documents.result.docAttachment.forEach(element => {
    this.headerdocumentdetails.push(element.DocumentUniqueID);
    });
    }
    }

    Continue reading...

Compartilhe esta Página