Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should handle rejections', async () => {
fetch.__setShouldReject(true);
fetch.__setResponse('THIS IS A REJECTION');
try {
await get('https://rejected.com');
} catch (err) {
expect(err).toBe('THIS IS A REJECTION');
}
});
});