Skip to content

Commit

Permalink
Fix lint issues (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
branko-stripe authored Nov 5, 2024
1 parent 0945ebe commit 67f99ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/internal/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export async function $fetch<T>(options: FetchOptions, needApiKey = true) {
Object.assign(response, { error: error as Error });
}

response.error && onError?.(response.error);
if (response.error) {
onError?.(response.error);
}

return response as FetchResponse<T>;
}

Expand Down
2 changes: 2 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe("Export", () => {
"getOrder",
"listOrders",
"generateOrderInvoice",
"issueOrderRefund",

// Order Items
"getOrderItem",
Expand All @@ -56,6 +57,7 @@ describe("Export", () => {
"getSubscriptionInvoice",
"listSubscriptionInvoices",
"generateSubscriptionInvoice",
"issueSubscriptionInvoiceRefund",

// Subscriptions Items
"getSubscriptionItem",
Expand Down
8 changes: 4 additions & 4 deletions test/products/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ describe("Retrieve a product", () => {
const { id, type, attributes, relationships } = data;
expect(id).toEqual(productId.toString());
expect(type).toEqual(DATA_TYPE);
expect(attributes).toBeDefined;
expect(relationships).toBeDefined;
expect(attributes).toBeDefined();
expect(relationships).toBeDefined();

const {
store_id,
Expand Down Expand Up @@ -222,8 +222,8 @@ describe("Retrieve a product", () => {
const { id, type, attributes, relationships } = data;
expect(id).toEqual(productId.toString());
expect(type).toEqual(DATA_TYPE);
expect(attributes).toBeDefined;
expect(relationships).toBeDefined;
expect(attributes).toBeDefined();
expect(relationships).toBeDefined();

const {
store_id,
Expand Down
2 changes: 1 addition & 1 deletion test/subscriptions/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("List all subscriptions", () => {

// Get active subscription
const activeSubscription = data.find((d) => {
d.attributes.status === "active";
return d.attributes.status === "active";
});

const { id, attributes } = activeSubscription ?? data[0];
Expand Down

0 comments on commit 67f99ea

Please sign in to comment.