-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-function.sh
More file actions
28 lines (22 loc) · 879 Bytes
/
test-function.sh
File metadata and controls
28 lines (22 loc) · 879 Bytes
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
#!/bin/bash
# Test script for get-topup-status Edge Function (Local Development)
SUPABASE_URL="http://localhost:54321"
ANON_KEY="your-anon-key-here"
echo "Testing get-topup-status Edge Function..."
echo "URL: $SUPABASE_URL/functions/v1/get-topup-status"
echo ""
# Test 1: Without auth (should fail with 401)
echo "Test 1: Without Authorization header"
curl -s -X GET "$SUPABASE_URL/functions/v1/get-topup-status" | jq .
echo ""
# Test 2: With invalid auth (should fail with 401)
echo "Test 2: With invalid token"
curl -s -X GET "$SUPABASE_URL/functions/v1/get-topup-status" \
-H "Authorization: Bearer invalid_token" | jq .
echo ""
echo "To test with valid token:"
echo "1. Login in your app"
echo "2. Get JWT token from Supabase"
echo "3. Run:"
echo "curl -X GET $SUPABASE_URL/functions/v1/get-topup-status \\"
echo " -H \"Authorization: Bearer YOUR_VALID_JWT_TOKEN\""