| 1274 | |
| 1275 | #[test] |
| 1276 | fn test_extract_const() { |
| 1277 | let mut extractor = TypeScriptExtractor::new(); |
| 1278 | let source = r#" |
| 1279 | const MAX_RETRIES = 3; |
| 1280 | const API_URL: string = "https://api.example.com"; |
| 1281 | "#; |
| 1282 | let entities = extractor.extract(source, "test.ts"); |
| 1283 | |
| 1284 | assert_eq!(entities.len(), 2); |
| 1285 | assert_eq!(entities[0].name, "MAX_RETRIES"); |
| 1286 | assert_eq!(entities[0].kind, EntityKind::Const); |
| 1287 | assert_eq!(entities[1].name, "API_URL"); |
| 1288 | assert_eq!(entities[1].kind, EntityKind::Const); |
| 1289 | } |
| 1290 | |
| 1291 | #[test] |
| 1292 | fn test_extract_class() { |