()
| 1259 | |
| 1260 | #[test] |
| 1261 | fn test_extract_arrow_function() { |
| 1262 | let mut extractor = TypeScriptExtractor::new(); |
| 1263 | let source = r#" |
| 1264 | const processData = (data: Data[]): Result => { |
| 1265 | return data.map(d => transform(d)); |
| 1266 | }; |
| 1267 | "#; |
| 1268 | let entities = extractor.extract(source, "test.ts"); |
| 1269 | |
| 1270 | assert_eq!(entities.len(), 1); |
| 1271 | assert_eq!(entities[0].name, "processData"); |
| 1272 | assert_eq!(entities[0].kind, EntityKind::Function); |
| 1273 | } |
| 1274 | |
| 1275 | #[test] |
| 1276 | fn test_extract_const() { |