Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
deciduously committed Nov 19, 2024
1 parent 3260f0e commit 4e099c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/server/src/package/check/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ async fn nonexistent_function() -> tg::Result<()> {
.await
}

#[tokio::test]
async fn no_return_value() -> tg::Result<()> {
test(
temp::directory! {
"tangram.ts" => indoc!(r"
export default tg.target(() => {});
"),
},
|_, output| async move {
assert_json_snapshot!(output, @r#"
{
"diagnostics": []
}
"#);
Ok(())
},
)
.await
}

async fn test<F, Fut>(artifact: temp::Artifact, assertions: F) -> tg::Result<()>
where
F: FnOnce(Server, tg::package::check::Output) -> Fut,
Expand Down

0 comments on commit 4e099c6

Please sign in to comment.