-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-quick.js
More file actions
23 lines (18 loc) · 912 Bytes
/
test-quick.js
File metadata and controls
23 lines (18 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Quick test to verify parseCMIF works in Node.js environment
import { parseCMIF } from './docs/js/cmif-parser.js';
console.log('Starting quick test...');
try {
const data = await parseCMIF('docs/data/test-uncertainty.xml');
console.log(`✓ Successfully parsed ${data.letters.length} letters`);
console.log(`✓ Has indices:`, Object.keys(data.indices));
console.log(`✓ Has meta:`, Object.keys(data.meta));
// Check date precision
const dayLetters = data.letters.filter(l => l.datePrecision === 'day');
console.log(`✓ Found ${dayLetters.length} letters with day precision`);
const monthLetters = data.letters.filter(l => l.datePrecision === 'month');
console.log(`✓ Found ${monthLetters.length} letters with month precision`);
console.log('\nAll basic checks passed!');
} catch (error) {
console.error('✗ Error:', error.message);
process.exit(1);
}