Skip to content

Commit 191edc3

Browse files
kevinpjonesclaude
andcommitted
Fix integration test failures
- BankAccountsApi: add jest.setTimeout(60s) to fix beforeAll timeout on list tests - CampaignsApi, CardsApi, TemplatesApi: replace deprecated jest global fail() with throw - UploadsApi: remove swallowed try/catch so campaign creation errors surface properly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 34a9678 commit 191edc3

5 files changed

Lines changed: 20 additions & 22 deletions

File tree

__tests__/BankAccountsApi.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { BankAccountsApi } from "../api/bank-accounts-api";
77
import { CONFIG_FOR_INTEGRATION } from "./testFixtures";
88

99
describe("BankAccountsApi", () => {
10+
jest.setTimeout(1000 * 60);
11+
1012
const dummyAccount = new BankAccountWritable({
1113
description: "Test Bank Account",
1214
routing_number: "322271627",
@@ -188,7 +190,7 @@ describe("BankAccountsApi", () => {
188190
previousUrl = prevUrl.searchParams.get("before") || "";
189191
}
190192
}
191-
}, 10000); // Timeout for concurrent API operations (reduced since Promise.all runs operations in parallel)
193+
});
192194

193195
afterAll(async () => {
194196
const bankAccountApi = new BankAccountsApi(CONFIG_FOR_INTEGRATION);

__tests__/CampaignsApi.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ describe("CampaignsApi", () => {
118118
])
119119
.then((creationResults) => {
120120
if (creationResults.length !== 3) {
121-
fail();
121+
throw new Error("Expected 3 campaigns to be created");
122122
}
123123
createdCampaigns = createdCampaigns.concat(creationResults);
124124
})
125125
.catch((err) => {
126-
fail(err);
126+
throw err;
127127
});
128128
});
129129

__tests__/CardsApi.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ describe("CardsApi", () => {
108108
])
109109
.then((creationResults) => {
110110
if (creationResults.length !== 3) {
111-
fail();
111+
throw new Error("Expected 3 cards to be created");
112112
}
113113
createdCards = createdCards.concat(creationResults);
114114
})
115115
.catch((err) => {
116-
fail(err);
116+
throw err;
117117
});
118118
});
119119

__tests__/TemplatesApi.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ describe("TemplatesApi", () => {
113113
])
114114
.then((creationResults) => {
115115
if (creationResults.length !== 3) {
116-
fail();
116+
throw new Error("Expected 3 templates to be created");
117117
}
118118
createdTemplates = createdTemplates.concat(creationResults);
119119
})
120120
.catch((err) => {
121-
fail(err);
121+
throw err;
122122
});
123123
});
124124

__tests__/UploadsApi.spec.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,17 @@ describe("UploadsApi", () => {
5454
let uploadWrite: UploadWritable;
5555

5656
beforeAll(async () => {
57-
try {
58-
const campaignsApi = new CampaignsApi(CONFIG_FOR_INTEGRATION);
59-
60-
const campaignWrite = new CampaignWritable({
61-
name:
62-
"TS Integration Test Campaign for uploads on day " +
63-
Date.now().toString(),
64-
schedule_type: CmpScheduleType.Immediate,
65-
});
66-
createdCampaign = await campaignsApi.create(campaignWrite);
67-
68-
expect(createdCampaign.id).toBeDefined();
69-
} catch (err: any) {
70-
console.error(err.message);
71-
}
57+
const campaignsApi = new CampaignsApi(CONFIG_FOR_INTEGRATION);
58+
59+
const campaignWrite = new CampaignWritable({
60+
name:
61+
"TS Integration Test Campaign for uploads on day " +
62+
Date.now().toString(),
63+
schedule_type: CmpScheduleType.Immediate,
64+
});
65+
createdCampaign = await campaignsApi.create(campaignWrite);
66+
67+
expect(createdCampaign.id).toBeDefined();
7268

7369
uploadWrite = new UploadWritable({
7470
campaignId: createdCampaign.id,

0 commit comments

Comments
 (0)