()
| 1214 | |
| 1215 | #[test] |
| 1216 | fn test_extract_arrow_function() { |
| 1217 | let mut extractor = TypeScriptExtractor::new(); |
| 1218 | let source = r#" |
| 1219 | const processData = (data: Data[]): Result => { |
| 1220 | return data.map(d => transform(d)); |
| 1221 | }; |
| 1222 | "#; |
| 1223 | let entities = extractor.extract(source, "test.ts"); |
| 1224 | |
| 1225 | assert_eq!(entities.len(), 1); |
| 1226 | assert_eq!(entities[0].name, "processData"); |
| 1227 | assert_eq!(entities[0].kind, EntityKind::Function); |
| 1228 | } |
| 1229 | |
| 1230 | #[test] |
| 1231 | fn test_extract_const() { |