forked from Blessedbiello/AiFininsights
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
44 lines (30 loc) · 1.27 KB
/
test.js
File metadata and controls
44 lines (30 loc) · 1.27 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
import StudentSpendAnalyzer from './src/analyzer.js';
async function testApplication() {
console.log('🧪 Testing Student Spend Analyzer...\n');
const analyzer = new StudentSpendAnalyzer();
try {
// Test 1: Load data
console.log('Test 1: Loading data...');
await analyzer.loadDataFromFile('./data/student-data.json');
console.log('✅ Data loaded successfully\n');
// Test 2: Validate data
console.log('Test 2: Validating data structure...');
analyzer.validateData();
console.log('✅ Data validation passed\n');
// Test 3: Analyze student
console.log('Test 3: Analyzing sample student...');
const analysis = analyzer.analyzeStudent('STU001');
console.log('✅ Student analysis completed');
console.log(` Student: ${analysis.studentInfo.name}`);
console.log(` Budget utilization: ${analysis.budget.utilization}%\n`);
// Test 4: Generate AI summary
console.log('Test 4: Generating AI summary...');
const summary = analyzer.generateSummaryForAI(analysis);
console.log('✅ AI summary generated');
console.log(` Summary length: ${summary.length} characters\n`);
console.log('🎉 All tests passed!');
} catch (error) {
console.error('❌ Test failed:', error.message);
}
}
testApplication();