Tested on web and native. Used https://httpstat.us/ to generate delayed responses.
For native, it's convenient to add a button to `dev-menu.js`:
```
lang=typescript
{
name: 'Test timeout',
callback: async () => {
try {
const response = await fetchWithTimeout('https://httpstat.us/200', {
timeout: 3000,
headers: {
'X-HttpStatus-Sleep': '4000',
},
});
const text = await response.text();
// for timeout > delay, this should be displayed with "OK"
Alert.alert('Got response', text);
} catch (e) {
// for timeout < delay, this should be displayed with "Request timed out"
Alert.alert('Got error:', getMessageForException(e));
}
},
},
```
When `externalSignal` is set, the error message is `AbortError: Operation aborted` on native and `DOMException: The user aborted a request.` on web