-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy path.env.test
More file actions
57 lines (51 loc) · 2.82 KB
/
Copy path.env.test
File metadata and controls
57 lines (51 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# =============================================================================
# Test environment defaults for the editor package.
#
# This file is COMMITTED and holds non-secret, deterministic defaults that
# apply to every developer's test runs. Secrets (Stripe keys, etc.) belong
# in `.env.test.local`, which is gitignored.
#
# Vitest picks both files up automatically via `vitest.config.ts`, so
# `pnpm vitest run lib/billing/__tests__/e2e` works with no shell ceremony.
#
# Loading precedence (highest priority wins; existing process.env is never
# overridden — see `loadEnvFile()` in vitest.config.ts):
# 1. process.env (from your shell) ← highest priority
# 2. .env.test.local ← per-developer secrets (gitignored)
# 3. .env.test ← this file (committed defaults)
# =============================================================================
NODE_ENV=test
# -----------------------------------------------------------------------------
# Billing E2E suite gates
# -----------------------------------------------------------------------------
# `BILLING_E2E=1` is intentionally NOT set here — the suite is opt-in
# because it requires Stripe credentials in `.env.test.local`. Enable it
# locally with `BILLING_E2E=1 pnpm vitest run lib/billing/__tests__/e2e`,
# or by adding `BILLING_E2E=1` to your `.env.test.local`.
BILLING_TEST_MODE=true
# Local dev server. The signed webhooks the suite generates are POSTed here.
APP_URL=http://localhost:3000
# -----------------------------------------------------------------------------
# Supabase — must be a local instance. The safety guard refuses any other
# host.
# -----------------------------------------------------------------------------
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
# `SUPABASE_SECRET_KEY` (sb_secret_…) is generated per-machine by the
# Supabase CLI on first `supabase start`. Copy it into `.env.test.local`:
# supabase status -o env | grep SUPABASE_SECRET_KEY >> editor/.env.test.local
# -----------------------------------------------------------------------------
# Stripe — fill in `.env.test.local` (gitignored). Each contributor uses
# their own free Stripe test account; we don't share credentials.
#
# STRIPE_SECRET_KEY=sk_test_...
# STRIPE_WEBHOOK_SECRET=whsec_...
#
# Setup flow for a fresh contributor:
# 1. Sign up at https://dashboard.stripe.com (free, no payment info)
# 2. Switch to test mode → Developers → API keys → copy `sk_test_...`
# 3. `stripe listen --forward-to localhost:3000/private/webhooks/stripe`
# → copy the `whsec_...` it prints
# 4. Drop both into `editor/.env.test.local`
# 5. Run `pnpm tsx editor/scripts/billing/setup-stripe-test.ts` once to
# provision per-account products/prices in your Stripe sandbox.
# -----------------------------------------------------------------------------