title: How do I test a rejected Angular (1.6.1) promise in jasmine?
body: <p>Below was my approach to testing rejected promises in angular 1.5.x. Updating to 1.6.1 has introduced the "Possibly unhandled rejection" error. I understand the purpose of this error, but I haven't figure out a simple way around it. Jasmine's (2.5.x) and.throwError() method seems to cause tests to fail by virtue of being an error.</p>
  
  <pre><code>describe('TestTarget', () =&gt; {
      let $q, $rootScope, TestTarget, SomeModel;
  
      beforeEach(() =&gt; {
          SomeModel = jasmine.createSpyObj('SomeModel', ['get']);
  
          module('something');
          module($provide =&gt; {
              $provide.value('SomeModel', SomeModel);
          });
  
          inject((_$q_, _$rootScope_, _TestTarget_) =&gt; {
              $q = _$q_;
              $rootScope = _$rootScope_;
              TestTarget = _TestTarget_;
          });
      });
  
      describe('get()', () =&gt; {
          it('on error, adds a danger message', () =&gt; {
              SomeModel.get.and.returnValue($q.reject());
              // SomeModel.get.and.throwError(); // doesn't work either
              TestTarget.get();
              $rootScope.$digest();
              expect(SomeModel.get).toHaveBeenCalled();
              expect(&lt;&lt; the rejection outcome of TestTarget.get().then() &gt;&gt;);
          });
      });
  });
  </code></pre>
  
  <p>I want to continue to pass rejected promises across my models, services, and controllers.</p>