-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-transaction-sync.js
More file actions
29 lines (24 loc) · 945 Bytes
/
Copy pathtest-transaction-sync.js
File metadata and controls
29 lines (24 loc) · 945 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
29
// Test script to manually run transaction sync
const { exec } = require('child_process');
console.log('🧪 Testing transaction sync locally...\n');
// Change NODE_ENV to development for local testing
process.env.NODE_ENV = 'development';
// Test via Telegram bot command
const testCommand = `curl -X POST http://localhost:3002/telegram/test -H "Content-Type: application/json" -d '{"message": {"text": "/transactions", "from": {"id": 12345}}}'`;
exec('npm run start:dev', (error, stdout, stderr) => {
if (error) {
console.error('Error starting app:', error);
return;
}
// Wait a bit for server to start, then test
setTimeout(() => {
console.log('📡 Testing /transactions command...');
exec(testCommand, (testError, testStdout, testStderr) => {
if (testError) {
console.error('Test error:', testError);
return;
}
console.log('Test result:', testStdout);
});
}, 3000);
});