-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-parser.js
More file actions
25 lines (21 loc) · 872 Bytes
/
test-parser.js
File metadata and controls
25 lines (21 loc) · 872 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
// Test script to verify the enhanced model parser logic
import { ModelParser } from './src/generator/model-parser';
async function testModelParser() {
const parser = new ModelParser();
const model = parser.parseModelFromFile('./example-test-model.ts', 'TestModel');
if (model) {
console.log('Model parsing test results:');
console.log('===========================');
model.properties.forEach(prop => {
console.log(`${prop.name}:`);
console.log(` Type: ${prop.type}`);
console.log(` Optional: ${prop.isOptional}`);
console.log(` Initial Value: ${prop.initialValue || 'none'}`);
console.log(` Array: ${prop.isArray}`);
console.log('---');
});
} else {
console.log('Failed to parse model');
}
}
testModelParser().catch(console.error);