We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8e9b643 + 37e099a commit 4225d78Copy full SHA for 4225d78
src/__test__/Request.test.ts
@@ -11,6 +11,19 @@ jest.setTimeout(+(process.env.BUGSNAG_TIMEOUT_MS as string) * 10)
11
let server: http.Server
12
afterEach(() => server?.close())
13
14
+const originalSetTimeout = http.ClientRequest.prototype.setTimeout
15
+
16
+beforeAll(() => {
17
+ // trigger a timeout without waiting much real time
18
+ http.ClientRequest.prototype.setTimeout = function(_timeout: number, cb?: () => void) {
19
+ return originalSetTimeout.call(this, 100, cb)
20
+ }
21
+})
22
23
+afterAll(() => {
24
+ http.ClientRequest.prototype.setTimeout = originalSetTimeout
25
26
27
test('request: isRetryable()', () => {
28
expect(isRetryable(undefined)).toBe(true)
29
expect(isRetryable(100)).toBe(true)
0 commit comments