SHARE
TWEET

Untitled

a guest Dec 13th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('Some test description', () => {
  2.   let _reject;
  3.  
  4.   beforeEach(() => {
  5.     _reject = Promise.reject()
  6.     _reject.catch(() => { })
  7.    
  8.     /* More implementation... */
  9.   })
  10.  
  11.   it('Test with error', () => {
  12.     const someMockError = jasmine.createSpy().and.returnValue(
  13.       Promise.reject(new Error('Unit Test Error'))
  14.     )
  15.    
  16.     /* The rest of implementation using this mock... */
  17.   })
  18. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top