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

Function test_extract_const

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

Source from the content-addressed store, hash-verified

1302
1303 #[test]
1304 fn test_extract_const() {
1305 let mut extractor = TypeScriptExtractor::new();
1306 let source = r#"
1307const MAX_RETRIES = 3;
1308const API_URL: string = "https://api.example.com";
1309"#;
1310 let entities = extractor.extract(source, "test.ts");
1311
1312 assert_eq!(entities.len(), 2);
1313 assert_eq!(entities[0].name, "MAX_RETRIES");
1314 assert_eq!(entities[0].kind, EntityKind::Const);
1315 assert_eq!(entities[1].name, "API_URL");
1316 assert_eq!(entities[1].kind, EntityKind::Const);
1317 }
1318
1319 #[test]
1320 fn test_extract_class() {

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected