code: function toReject() {
    return {
      compare(actual) {
        assertPromise(actual);
        const failure = jasmine.createSpy('Promise failure callback');
        actual.then(angular.noop, failure);
        createScope().$digest();
        const pass = isJasmine2 ? failure.calls.any() : failure.calls.length > 0;
  
        return getResult('toReject', pass, 'Expected promise {not} to have been rejected');
      }
    };
  }
docs: /*
  Asserts whether the actual promise object is rejected