Skip to content

Commit 5fd4e02

Browse files
authored
Merge pull request #167 from square/mikekono-patch-1
Update integration.yml
2 parents 104a65c + c6d25a6 commit 5fd4e02

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ jobs:
1515
uses: actions/setup-node@v3
1616

1717
- name: Run integration tests
18-
# TODO: Replace the following 'run' statement with the following when TEST_SQUARE_TOKEN secret exists.
19-
# run: yarn && yarn test:integration
20-
run: yarn
18+
run: yarn && yarn test:integration

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"prepack": "cp -rv dist/. .",
1313
"test": "yarn test:unit",
1414
"test:unit": "jest --testPathPattern=tests/unit",
15-
"test:integration": "jest --testPathPattern=tests/integration"
15+
"test:integration": "jest '.*tests\\/integration\\/(?!.*\\.serial\\.test\\.ts$).*\\.test\\.ts$'; jest '.*tests\\/integration\\/.*\\.serial\\.test\\.ts$' --runInBand"
1616
},
1717
"dependencies": {
1818
"url-join": "4.0.1",

tests/integration/customerGroups.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ function deleteTestCustomerGroup(client: SquareClient, groupId: string): Promise
1717
describe("CustomerGroups API", () => {
1818
const client = createClient();
1919

20-
it("should list customer groups", async () => {
21-
const response = await client.customers.groups.list();
22-
23-
expect(response.data).toBeDefined();
24-
expect(response.data.length).toBeGreaterThan(0);
25-
});
26-
27-
it("should create a customer group", async () => {
20+
it("should create and list a customer group", async () => {
21+
// create
2822
const response = await createTestCustomerGroup(client);
2923

3024
expect(response.group).toBeDefined();
3125
expect(response.group?.name).toBeDefined();
3226

27+
// list
28+
const listResponse = await client.customers.groups.list();
29+
30+
expect(listResponse.data).toBeDefined();
31+
expect(listResponse.data.length).toBeGreaterThan(0);
32+
3333
// Cleanup
3434
await deleteTestCustomerGroup(client, response.group?.id!);
3535
});

tests/integration/disputes.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("Disputes API", () => {
88

99
beforeAll(async () => {
1010
// Create a payment that will generate a dispute
11-
await client.payments.create({
11+
const paymentsResp = await client.payments.create({
1212
idempotencyKey: newTestUuid(),
1313
autocomplete: true,
1414
sourceId: "cnon:card-nonce-ok",
@@ -19,7 +19,7 @@ describe("Disputes API", () => {
1919
});
2020

2121
// Poll for dispute to be created
22-
for (let i = 0; i < 20; i++) {
22+
for (let i = 0; i < 100; i++) {
2323
const disputeResponse = await client.disputes.list({
2424
states: "EVIDENCE_REQUIRED",
2525
});
@@ -45,7 +45,7 @@ describe("Disputes API", () => {
4545
evidenceText: "This is not a duplicate",
4646
});
4747
textEvidenceId = evidenceResponse.evidence!.id!;
48-
}, 60_000);
48+
}, 200_000);
4949

5050
afterAll(async () => {
5151
// Clean up evidence if it exists

0 commit comments

Comments
 (0)