title: Jasmine: test a setTimeout function throws an error
body: <p>I would like to test the error handling of a method, which schedules work with setTimeout. The error will be thrown in the scheduled part, i.e.:</p>
  
  <pre><code>function sutWithSetTimeout() {
      setTimeout(function () { throw new Error("pang"); }, 1);
  }
  </code></pre>
  
  <p>How do I test that an error is thrown and that it has the correct message?</p>