Skip to content

Commit 4e099c6

Browse files
committed
add test
1 parent 3260f0e commit 4e099c6

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • packages/server/src/package/check

packages/server/src/package/check/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,26 @@ async fn nonexistent_function() -> tg::Result<()> {
7070
.await
7171
}
7272

73+
#[tokio::test]
74+
async fn no_return_value() -> tg::Result<()> {
75+
test(
76+
temp::directory! {
77+
"tangram.ts" => indoc!(r"
78+
export default tg.target(() => {});
79+
"),
80+
},
81+
|_, output| async move {
82+
assert_json_snapshot!(output, @r#"
83+
{
84+
"diagnostics": []
85+
}
86+
"#);
87+
Ok(())
88+
},
89+
)
90+
.await
91+
}
92+
7393
async fn test<F, Fut>(artifact: temp::Artifact, assertions: F) -> tg::Result<()>
7494
where
7595
F: FnOnce(Server, tg::package::check::Output) -> Fut,

0 commit comments

Comments
 (0)