()
| 1287 | |
| 1288 | #[test] |
| 1289 | fn test_extract_arrow_function() { |
| 1290 | let mut extractor = TypeScriptExtractor::new(); |
| 1291 | let source = r#" |
| 1292 | const processData = (data: Data[]): Result => { |
| 1293 | return data.map(d => transform(d)); |
| 1294 | }; |
| 1295 | "#; |
| 1296 | let entities = extractor.extract(source, "test.ts"); |
| 1297 | |
| 1298 | assert_eq!(entities.len(), 1); |
| 1299 | assert_eq!(entities[0].name, "processData"); |
| 1300 | assert_eq!(entities[0].kind, EntityKind::Function); |
| 1301 | } |
| 1302 | |
| 1303 | #[test] |
| 1304 | fn test_extract_const() { |