Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Some test description', () => {
- let _reject;
- beforeEach(() => {
- _reject = Promise.reject()
- _reject.catch(() => { })
- /* More implementation... */
- })
- it('Test with error', () => {
- const someMockError = jasmine.createSpy().and.returnValue(
- Promise.reject(new Error('Unit Test Error'))
- )
- /* The rest of implementation using this mock... */
- })
- })
Add Comment
Please, Sign In to add comment