Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ jobs:
uses: actions/setup-node@v3

- name: Run integration tests
# TODO: Replace the following 'run' statement with the following when TEST_SQUARE_TOKEN secret exists.
# run: yarn && yarn test:integration
run: yarn
run: yarn && yarn test:integration
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"prepack": "cp -rv dist/. .",
"test": "yarn test:unit",
"test:unit": "jest --testPathPattern=tests/unit",
"test:integration": "jest --testPathPattern=tests/integration"
"test:integration": "jest '.*tests\\/integration\\/(?!.*\\.serial\\.test\\.ts$).*\\.test\\.ts$'; jest '.*tests\\/integration\\/.*\\.serial\\.test\\.ts$' --runInBand"
},
"dependencies": {
"url-join": "4.0.1",
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/customerGroups.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ function deleteTestCustomerGroup(client: SquareClient, groupId: string): Promise
describe("CustomerGroups API", () => {
const client = createClient();

it("should list customer groups", async () => {
const response = await client.customers.groups.list();

expect(response.data).toBeDefined();
expect(response.data.length).toBeGreaterThan(0);
});

it("should create a customer group", async () => {
it("should create and list a customer group", async () => {
// create
const response = await createTestCustomerGroup(client);

expect(response.group).toBeDefined();
expect(response.group?.name).toBeDefined();

// list
const listResponse = await client.customers.groups.list();

expect(listResponse.data).toBeDefined();
expect(listResponse.data.length).toBeGreaterThan(0);

// Cleanup
await deleteTestCustomerGroup(client, response.group?.id!);
});
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/disputes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("Disputes API", () => {

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

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

afterAll(async () => {
// Clean up evidence if it exists
Expand Down
Loading