-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-optimizer-output.js
More file actions
39 lines (32 loc) · 1.15 KB
/
test-optimizer-output.js
File metadata and controls
39 lines (32 loc) · 1.15 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
const axios = require("axios");
const sampleInput = `# Network issue troubleshooting guide
## Instructions
- test networking connectivity by pinging google
- check the dns resolution works properly
- verify http response: you should be able to see the ping is within 100ms, and http returns 200 status and dns resolves to valid IP address.
## References:
- [terminologies](https://en.wikipedia.org/wiki/Network_troubleshooting)`;
async function testOptimizer() {
try {
console.log("🔧 Testing optimizer with sample input...\n");
console.log("INPUT:");
console.log(sampleInput);
console.log("\n" + "=".repeat(60) + "\n");
const response = await axios.post(
"http://localhost:3001/api/optimizer/optimize",
{
text: sampleInput,
}
);
console.log("OUTPUT:");
console.log(response.data.optimizedText);
console.log("\n" + "=".repeat(60) + "\n");
console.log("✅ Optimizer test completed successfully!");
} catch (error) {
console.error("❌ Error testing optimizer:", error.message);
if (error.response) {
console.error("Response data:", error.response.data);
}
}
}
testOptimizer();