Skip to content

Commit 2e64cfb

Browse files
committed
fix: add NextRequest import to billing portal tests to fix Request polyfill
1 parent fe5324a commit 2e64cfb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

web/src/app/api/orgs/[orgId]/billing/portal/__tests__/org-billing-portal.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { describe, expect, mock, test } from 'bun:test'
2+
import { NextRequest } from 'next/server'
23

34
import type { Logger } from '@codebuff/common/types/contracts/logger'
45

56
import { postOrgBillingPortal } from '../_post'
67

8+
// NextRequest import above sets up the global Request polyfill needed by NextResponse
9+
void NextRequest
10+
711
import type {
812
CreateBillingPortalSessionFn,
913
GetMembershipFn,

web/src/app/api/user/billing-portal/__tests__/billing-portal.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { describe, expect, mock, test } from 'bun:test'
2+
import { NextRequest } from 'next/server'
23

34
import type { Logger } from '@codebuff/common/types/contracts/logger'
45

56
import { postBillingPortal } from '../_post'
67

8+
// NextRequest import above sets up the global Request polyfill needed by NextResponse
9+
void NextRequest
10+
711
import type { CreateBillingPortalSessionFn, GetSessionFn, Session } from '../_post'
812

913
const createMockLogger = (errorFn = mock(() => {})): Logger => ({

0 commit comments

Comments
 (0)