MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_extract_function

Function test_extract_function

atomic-semantic/src/parser.rs:1185–1198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1183
1184 #[test]
1185 fn test_extract_function() {
1186 let mut extractor = TypeScriptExtractor::new();
1187 let source = r#"
1188function authenticate(username: string, password: string): Promise<User> {
1189 return fetch('/api/login', { username, password });
1190}
1191"#;
1192 let entities = extractor.extract(source, "test.ts");
1193
1194 assert_eq!(entities.len(), 1);
1195 assert_eq!(entities[0].name, "authenticate");
1196 assert_eq!(entities[0].kind, EntityKind::Function);
1197 assert!(!entities[0].exported);
1198 }
1199
1200 #[test]
1201 fn test_extract_exported_function() {

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected