Vue file without lang attr should parse script as JavaScript.
(self)
| 457 | assert nodes[0].kind == "File" |
| 458 | |
| 459 | def test_parse_vue_js_default(self): |
| 460 | """Vue file without lang attr should parse script as JavaScript.""" |
| 461 | source = ( |
| 462 | b"<script>\n" |
| 463 | b"export default {\n" |
| 464 | b" methods: {\n" |
| 465 | b" greet() { return 'hi' }\n" |
| 466 | b" }\n" |
| 467 | b"}\n" |
| 468 | b"</script>\n" |
| 469 | ) |
| 470 | path = Path("js_default.vue") |
| 471 | nodes, edges = self.parser.parse_bytes(path, source) |
| 472 | funcs = [n for n in nodes if n.kind == "Function"] |
| 473 | func_names = {f.name for f in funcs} |
| 474 | assert "greet" in func_names |
| 475 | |
| 476 | # --- Dart tests --- |
| 477 |
nothing calls this directly
no test coverage detected