title: SpyingOn multiple sync functions with Jasmine Angular7
body: <p>I have an async function with calls two additional async functions that return data from a service. Then I check the status of what each async call returned and do some basic logic. I am trying to test by spying on each one and returning a value for each case. </p>
  
  <pre><code>export class service{
  
  constructor (readony someOtherService: SomeOtherService){}
  
  public async myfunction(): Promise&lt;any&gt; {
   const response1 = await this.getResponse1();
   const resposne2 = await this.getResponse2();
   let returnValue = 0l
  if(response1){
      returnValue = 1
  } else if (response2){
     returnValue = 2
  }
  return returnValue;
  
  
  public async getResponse1() {
     this.someOtherService.checkFeature("isOneActive").toPromise();
  }
  public async getResponse2() {
     this.someOtherService.checkFeature("isTwoActive").toPromise();
  }
  
  }
  </code></pre>
  
  <p>I am trying to test like this</p>
  
  <pre><code> describe(When my function is called, () =&gt;{ 
  
       describe(And returnValue 1 is false AND returnValue2 is false, () =&gt; {
  
        beforeEach(function(){
         //works correctly, never enters getResponse1
         spyOn(service, 'getResponse1').andreturnValue(Promise.resolve(false))
  
         //does not appear to work, code always enters getResponse2, and then fails. 
         spyOn(service, 'getResponse2').andreturnValue(Promise.resolve(false)) 
  
         expect(service.myFunction()).toEqaul(0))
          }
      }
  }
  </code></pre>
  
  <p>The interesting part is that the first call appears to be spied correctly and never enters 'getResponse1'. Now the second call ALWAYS enters 'getResponse2' even though it is spied in the same way. If I change the order, only the first 'getResponse' function is spied correctly.</p>
  
  <p>From what I read it is completely possible to spyOn more than 1 async function in Jasmine. </p>