(path: Path, source: str)
| 8 | |
| 9 | |
| 10 | def _method_edges(path: Path, source: str) -> set[tuple[str, str, str]]: |
| 11 | path.write_text(source, encoding="utf-8") |
| 12 | result = extract_js(path) |
| 13 | nodes = {node["id"]: node for node in result["nodes"]} |
| 14 | methods = set() |
| 15 | for edge in result["edges"]: |
| 16 | if edge["relation"] == "method": |
| 17 | owner = nodes[edge["source"]] |
| 18 | method = nodes[edge["target"]] |
| 19 | assert Path(method["source_file"]) == path |
| 20 | assert edge["source_location"] == method["source_location"] |
| 21 | methods.add((owner["label"], method["label"], method["source_location"])) |
| 22 | return methods |
| 23 | |
| 24 | |
| 25 | @pytest.mark.parametrize("suffix", [".ts", ".tsx"]) |
no test coverage detected