Skip to content

Commit ca59e04

Browse files
feat: enhance type checking for tests (#171)
1 parent 7702d5d commit ca59e04

22 files changed

+31
-20
lines changed

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
6868
run: pnpm build
6969

7070
- name: Test
71-
run: pnpm test
71+
run: pnpm test && pnpm typecheck:tests

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"build-esm": "tsc -b tsconfig.esm.json && echo '{\"type\":\"module\"}' > ./dist/esm/package.json",
1616
"build-cjs": "tsc -b tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
1717
"build-types": "tsc -b tsconfig.types.json",
18+
"typecheck:tests": "tsc -b tsconfig.tests.json",
1819
"prettier": "prettier --check ./src",
1920
"prettier:fix": "prettier --check ./src --write",
2021
"lint": "eslint ./src",

src/__tests__/internal/logger.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { type Response } from 'node-fetch';
21
import { LogLevel } from '../../internal/index.js';
32
import { Logger } from '../../internal/base/logger.js';
43

src/__tests__/mocks/notifications/payment-method-saved.mock.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
* Changes may be overwritten as part of auto-generation.
55
*/
66

7-
import { type IEventsResponse, type IPaymentMethodResponse } from '../../../types/index.js';
7+
import { type IEventsResponse } from '../../../types/index.js';
8+
import { IPaymentMethodNotificationResponse } from '../../../notifications/index.js';
89

9-
export const PaymentMethodSavedMock: IEventsResponse<IPaymentMethodResponse> = {
10+
export const PaymentMethodSavedMock: IEventsResponse<IPaymentMethodNotificationResponse> = {
1011
event_id: 'evt_01hwvkmsge7bhq1a31s35784zt',
1112
event_type: 'payment_method.saved',
1213
occurred_at: '2024-05-02T02:55:25.198953Z',

src/__tests__/mocks/notifications/subscription-activated.mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const SubscriptionActivatedMock: IEventsResponse<ISubscriptionNotificatio
1414
notification_id: 'ntf_01h7ht60qc1tcdk0hfms98bmhp',
1515
data: {
1616
id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k',
17-
transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5',
1817
items: [
1918
{
2019
price: {

src/__tests__/mocks/notifications/subscription-canceled.mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const SubscriptionCanceledMock: IEventsResponse<ISubscriptionNotification
1414
notification_id: 'ntf_01h7jk37xbxzq9f7fdery7eab5',
1515
data: {
1616
id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k',
17-
transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5',
1817
items: [
1918
{
2019
price: {

src/__tests__/mocks/notifications/subscription-created.mock.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* Changes may be overwritten as part of auto-generation.
55
*/
66

7-
import { ISubscriptionNotificationResponse } from '../../../notifications/index.js';
7+
import type { ISubscriptionCreatedNotificationResponse } from '../../../notifications/index.js';
88
import { IEventsResponse } from '../../../types/index.js';
99

10-
export const SubscriptionCreatedMock: IEventsResponse<ISubscriptionNotificationResponse> = {
10+
export const SubscriptionCreatedMock: IEventsResponse<ISubscriptionCreatedNotificationResponse> = {
1111
event_id: 'evt_01h7ht60jy5hpdv5x8tfsaxje4',
1212
event_type: 'subscription.created',
1313
occurred_at: '2023-08-11T08:07:38.334150Z',

src/__tests__/mocks/notifications/subscription-imported.mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const SubscriptionImportedMock: IEventsResponse<ISubscriptionNotification
1414
notification_id: 'ntf_01gxwxwnjq16bhp2pz9p78cbk1',
1515
data: {
1616
id: 'sub_01gxwxwn84xqf0690d7qn5r2g7',
17-
transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5',
1817
items: [
1918
{
2019
price: {

src/__tests__/mocks/notifications/subscription-past-due.mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const SubscriptionPastDueMock: IEventsResponse<ISubscriptionNotificationR
1414
notification_id: 'ntf_01h7jagthb2kg1vqtf6rr8xspa',
1515
data: {
1616
id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k',
17-
transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5',
1817
items: [
1918
{
2019
price: {

src/__tests__/mocks/notifications/subscription-paused.mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const SubscriptionPausedMock: IEventsResponse<ISubscriptionNotificationRe
1414
notification_id: 'ntf_01h7jcst74a4417kz8eedqty0e',
1515
data: {
1616
id: 'sub_01h7ht5z5wdg9pz18jx1fagp8k',
17-
transaction_id: 'txn_01h8bxpvx398a7zbawb77y0kp5',
1817
items: [
1918
{
2019
price: {

0 commit comments

Comments
 (0)