Skip to content

Commit 3da2971

Browse files
committed
lower timeout
1 parent 0ac5e65 commit 3da2971

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

test/integration/live-api.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ function createClient(opts = {}) {
5555
],
5656
}
5757

58-
return createProxy(new Transloadit({ authKey, authSecret, gotRetry, ...opts }))
58+
// lower timeout so we don't get a race condition with test timeout which is 60sec
59+
const timeout = 30000
60+
61+
return createProxy(new Transloadit({ authKey, authSecret, gotRetry, timeout, ...opts }))
5962
}
6063

6164
function createAssembly(client: Transloadit, params: CreateAssemblyOptions) {

test/util.ts

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,29 @@ export const createProxy = (transloaditInstance: Transloadit) => {
1616
// @ts-expect-error any
1717
const newPromise = result.catch((err) => {
1818
if (err instanceof Error && 'cause' in err && err.cause instanceof RequestError) {
19-
if (err.cause.request) {
20-
if (err.cause.request != null) {
21-
Object.defineProperty(err.cause.request, 'toJSON', {
22-
value: () => undefined,
23-
enumerable: false,
24-
})
25-
}
26-
if (err.cause.response != null) {
27-
Object.defineProperty(err.cause.response, 'toJSON', {
28-
value: () => undefined,
29-
enumerable: false,
30-
})
31-
}
32-
if (err.cause.options != null) {
33-
Object.defineProperty(err.cause.options, 'toJSON', {
34-
value: () => undefined,
35-
enumerable: false,
36-
})
37-
}
38-
if (err.cause.timings != null) {
39-
Object.defineProperty(err.cause.timings, 'toJSON', {
40-
value: () => undefined,
41-
enumerable: false,
42-
})
43-
}
19+
if (err.cause.request != null) {
20+
Object.defineProperty(err.cause.request, 'toJSON', {
21+
value: () => undefined,
22+
enumerable: false,
23+
})
24+
}
25+
if (err.cause.response != null) {
26+
Object.defineProperty(err.cause.response, 'toJSON', {
27+
value: () => undefined,
28+
enumerable: false,
29+
})
30+
}
31+
if (err.cause.options != null) {
32+
Object.defineProperty(err.cause.options, 'toJSON', {
33+
value: () => undefined,
34+
enumerable: false,
35+
})
36+
}
37+
if (err.cause.timings != null) {
38+
Object.defineProperty(err.cause.timings, 'toJSON', {
39+
value: () => undefined,
40+
enumerable: false,
41+
})
4442
}
4543
}
4644
throw err

0 commit comments

Comments
 (0)