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

Function test_extract_function

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

Source from the content-addressed store, hash-verified

1228
1229 #[test]
1230 fn test_extract_function() {
1231 let mut extractor = TypeScriptExtractor::new();
1232 let source = r#"
1233function authenticate(username: string, password: string): Promise<User> {
1234 return fetch('/api/login', { username, password });
1235}
1236"#;
1237 let entities = extractor.extract(source, "test.ts");
1238
1239 assert_eq!(entities.len(), 1);
1240 assert_eq!(entities[0].name, "authenticate");
1241 assert_eq!(entities[0].kind, EntityKind::Function);
1242 assert!(!entities[0].exported);
1243 }
1244
1245 #[test]
1246 fn test_extract_exported_function() {

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected