lundi 4 juin 2018

Angular5 - Test a function that calls a http service inside

I need to test this function.

When I click this function getallproductcomponent(), execute this service function getallproductservice() and return all products. Any idea please, how to test this?

  getallproductcomponent() {
    this.ws.getallproductservice().subscribe(
      item=> {
        this.item= item;
      }
    );
  }

Aucun commentaire:

Enregistrer un commentaire