Guest User

Untitled

a guest
Dec 13th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  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. })
Add Comment
Please, Sign In to add comment