Skip to content

Commit

Permalink
Update fixture tests crate to be async
Browse files Browse the repository at this point in the history
Reviewed By: josephsavona

Differential Revision: D49867238

fbshipit-source-id: 920cd022c16b556ab42ab4ebd30cfa79fc94d3ec
  • Loading branch information
captbaritone authored and facebook-github-bot committed Oct 3, 2023
1 parent c899a68 commit 55db0b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/crates/fixture-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//! `tests/first_transform/mod.rs` exports the transform to test, for example:
//!
//! ```ignore
//! pub fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String> {
//! pub async fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String> {
//! Ok(fixture.to_uppercase())
//! }
//! ```
Expand Down
6 changes: 3 additions & 3 deletions compiler/crates/fixture-tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ fn main() {
.map(|(_, test_case)| {
let test_case_name = &test_case.name;
format!(
r#"#[test]
fn {0}() {{
r#"#[tokio::test]
async fn {0}() {{
let input = include_str!("{1}/fixtures/{2}");
let expected = include_str!("{1}/fixtures/{3}");
test_fixture(transform_fixture, "{2}", "{1}/fixtures/{3}", input, expected);
test_fixture(transform_fixture, "{2}", "{1}/fixtures/{3}", input, expected).await;
}}"#,
test_case.name,
&test_name,
Expand Down

0 comments on commit 55db0b0

Please sign in to comment.