Skip to content

Commit 31b25ce

Browse files
steebchenclaude
andcommitted
fix(test): guard Stripe init in skipped bonus-flow spec
The describe.skipIf callback body still runs at collection time, so new Stripe(stripeKey!) threw in CI where STRIPE_SECRET_KEY is unset. Construct the client only when a test key is present. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9e0c1ee commit 31b25ce

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/api/src/routes/end-user-bonus-flow.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ interface AdminMetrics {
4141
describe.skipIf(!hasStripeTestKey)(
4242
"end-user bonus full flow (real Stripe)",
4343
() => {
44-
const stripe = new Stripe(stripeKey!);
44+
const stripe = hasStripeTestKey
45+
? new Stripe(stripeKey!)
46+
: (undefined as unknown as Stripe);
4547
let adminCookie: string;
4648

4749
beforeEach(async () => {

0 commit comments

Comments
 (0)