title: How to test promise in jasmine & karma
body: <p>I have a test case as follow:</p>
  
  <pre><code>it("Should have a valid structure", function(done){ 
  
      var data;
      module(APP_MODULE_NAME);
  
      inject(function(_metaService_){
          metaService = _metaService_;            
      });
  
      metaService.fetchEntityMeta('person').then(function(data){
          expect(data.status).toBe( true );
          done();
      });
  
  });
  </code></pre>
  
  <p>But i am getting following error:</p>
  
  <pre><code>Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
  </code></pre>
  
  <p>I have increased jasmine.DEFAULT_TIMEOUT_INTERVAL but not use. 
  But following code does work.</p>
  
  <pre><code>    setTimeout(function(){
          expect(true).toBe(true);
          done();
      }, 5000);
  </code></pre>
  
  <p>So, my understanding is I am having problem with promise. 
  My question is how can i check the data returned by the promise.</p>