title: Jasmine - wait for fadeOut() to finish
body: <p>I have a simple function which fades in an element:</p>
  
  <p><strong>CODE</strong></p>
  
  <pre><code>checkLengthSelect: function(){
      if($(this).val() != ''){ // if not empty
          $('.c--error').fadeOut('fast', function(){
              $('#button').fadeIn();
          })
      } else { // if empty hide button and show error message
          $('#button').fadeOut('fast', function(){
              $('.c--error').html('foo').fadeIn(); // &lt;-- I want to test this on fadeOut callback
          })
      }
  },
  </code></pre>
  
  <p>I'm trying to write a test for it like this:</p>
  
  <p><strong>TEST</strong></p>
  
  <pre><code>it("it should have a value or hide continue button", function(){
  
      // check cover length on select
      $(document).on('change', '#select', function(){ qqw.validate.checkLengthSelect.call(this) } );
  
      // force a change event to fire with empty value.
      $('#select').val('').change();
  
      setTimeout(function(){
          expect($('.c--error').html()).toEqual('foo');   
          done(); // &lt;-- test if done
      }, 800);
  
  });
  </code></pre>
  
  <p><strong>ERROR</strong></p>
  
  <p>This shows in console </p>
  
  <p><code>'expect' was used when there was no current spec, this could be because an asynchronous test timed out</code></p>
  
  <p><strong>QUESTION</strong></p>
  
  <p>How can I test that an event happens when the <code>fadeOut</code> completes?</p>
  
  <p>I'm using Jasmine v2+</p>