-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathtest-agent.sh
More file actions
executable file
·49 lines (40 loc) · 1.03 KB
/
Copy pathtest-agent.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.03 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
#!/bin/bash
# Complete test script for x402 AI Agent
# This script tests both unpaid and paid request flows
set -e
echo "🧪 x402 AI Agent Test Suite"
echo "============================"
echo ""
# Check if agent is running
echo "1️⃣ Checking if agent is running..."
if ! curl -s http://localhost:3000/health > /dev/null 2>&1; then
echo "❌ Agent is not running!"
echo ""
echo "Please start the agent first:"
echo " npm start"
echo ""
exit 1
fi
echo "✅ Agent is running"
echo ""
# Check if .env exists
if [ ! -f ".env" ]; then
echo "⚠️ Warning: No .env file found"
echo "Creating .env from .env.example..."
cp .env.example .env
echo ""
echo "Please edit .env and add your configuration, then run this script again."
exit 1
fi
# Build the test client if needed
if [ ! -d "dist" ]; then
echo "2️⃣ Building project..."
npm run build
echo ""
fi
# Run the test client
echo "3️⃣ Running test client..."
echo ""
node dist/testClient.js
echo ""
echo "✅ Test suite complete!"