title: Protractor/Jasmine2: Asynchronous test "expect"s ignored, test is given a false pass
body: <p>I currently am using Protractor and Jasmine 2 to test my app. I use asyncawait to handle asynchronous bits. I'm running a test that essentially does the following:</p>
  
  <pre><code>it("should do asynchronous stuff", async(function (done) {
      var result = await(doSomeAsynchronousAction());
  
      expect(result.success).toBe(true);
      expect(result.message).toBe('');
      done();
  }));
  </code></pre>
  
  <p>Most of the times this is working as expected, but I have a certain test where the results of the "expect"s is being ignored. I placed a breakpoint at each expectation, and I verified that both of these should have failed (result.success was false, and result.message was not an empty string). The test is still reported as having succeeded, however, and no failures are reported. Does anyone have an idea why? I'm not even sure where to start.</p>
  
  <p><strong>UPDATE:</strong> I've determined that this is due to a customer wrapper I've created for Jasmine's it, though I'm not sure why it's causing this. Here's the relevant code:</p>
  
  <pre><code>var oldIt = jasmine.getEnv().it;
  global.rit = function () {
      var args = [arguments[0], arguments[1], 240000];
      var spec = oldIt.apply(null, args);
      specs[spec.result.fullName] = { spec: spec, essential: true };
      return spec;
  };
  jasmine.getEnv().it = function () {
      var spec = oldIt.apply(null, arguments);
      specs[spec.result.fullName] = { spec: spec, essential: false };
      return spec;
  };
  </code></pre>
  
  <p>I need to collect this information for use later in my custom reporter. Strangely, although I've modified <code>it</code> and <code>rit</code> to do very similar things, they are not acting the same. If I use <code>it</code> (which is using the wrapper I've created), expectations cause a failure in my tests as expected. If I use <code>rit</code>, the failed expectations do nothing at all. What is the difference here? <code>rit</code> is still creating a spec, since my code is being run, but it's ignoring my assertions? </p>