title: response is undefined in jasmine unit test
body: <p>test case </p>
  
  <pre><code>it('SaveVersionMainScreen', fakeAsync(() =&gt; {
          let response = comp.SaveVersionMainScreen();// return undefined instead of false
          fixture.detectChanges();
          expect(response).toEqual(false);
      }));
  </code></pre>
  
  <p>This is my component method which is tried to test </p>
  
  <pre><code>SaveVersionMainScreen() {
          let element = this.commonValidation(true);// return null
          if (element) {            
              return false;
          }else{
            return true  
          }
       }
  </code></pre>
  
  <p>When i running my test case, the <code>this.commonValidation(true)</code> returns null. So the if condition is passed <code>true</code> and <code>SaveVersionMainScreen()</code> is returning <code>false</code>. But I am getting <code>undefined</code> in  my test case.</p>
  
  <p><code>let response = comp.SaveVersionMainScreen(); //  response is undefined</code></p>