Skip to content

Commit d32ec97

Browse files
vvezrepeterbarker
authored andcommitted
Expand_typescript_generator_import_regression
1 parent 241e4fb commit d32ec97

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/test_mavgen_typescript.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ def test_typescript_generator_uses_scoped_node_mavlink_package():
3232

3333
assert ok is True
3434

35-
heartbeat = (output_dir / "messages" / "heartbeat.ts").read_text(encoding="utf-8")
36-
registry = (output_dir / "message-registry.ts").read_text(encoding="utf-8")
35+
generated_typescript_files = sorted(output_dir.rglob("*.ts"))
36+
assert generated_typescript_files
3737

38-
assert "@ifrunistuttgart/node-mavlink" in heartbeat
39-
assert "from 'node-mavlink'" not in heartbeat
40-
assert "@ifrunistuttgart/node-mavlink" in registry
41-
assert "from 'node-mavlink'" not in registry
38+
file_contents = {
39+
path.relative_to(output_dir).as_posix(): path.read_text(encoding="utf-8")
40+
for path in generated_typescript_files
41+
}
42+
43+
assert "@ifrunistuttgart/node-mavlink" in file_contents["message-registry.ts"]
44+
assert "from 'node-mavlink'" not in "\n".join(file_contents.values())

0 commit comments

Comments
 (0)