Skip to content

Commit 1010ce2

Browse files
fix: add render test to resolve dead code warnings
1 parent 18940ad commit 1010ce2

6 files changed

Lines changed: 69 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repository = "https://github.com/RustForWeb/yew-utils"
1010
version = "0.1.4"
1111

1212
[workspace.dependencies]
13+
tokio = "1.47.1"
1314
yew = "0.21.0"
1415

1516
[patch.crates-io]

packages/yew-struct-component/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ version.workspace = true
1111
[dependencies]
1212
yew.workspace = true
1313
yew-struct-component-macro = { path = "../yew-struct-component-macro", version = "0.1.4" }
14+
15+
[dev-dependencies]
16+
tokio = { workspace = true, features = [
17+
"macros",
18+
"rt-multi-thread",
19+
"test-util",
20+
] }
21+
yew = { workspace = true, features = ["ssr"] }

packages/yew-struct-component/tests/struct_component.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::fmt::{self, Display};
22

3-
use yew::prelude::*;
3+
use yew::{ServerRenderer, prelude::*};
44
use yew_struct_component::{Attributes, StructComponent, struct_component};
55

66
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
@@ -141,3 +141,9 @@ fn App() -> Html {
141141
</Box>
142142
}
143143
}
144+
145+
#[tokio::test]
146+
async fn test() {
147+
let renderer = ServerRenderer::<App>::new();
148+
renderer.render().await;
149+
}

packages/yew-style/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ version.workspace = true
1111
[dependencies]
1212
indexmap = "2.6.0"
1313
yew.workspace = true
14+
15+
[dev-dependencies]
16+
tokio = { workspace = true, features = [
17+
"macros",
18+
"rt-multi-thread",
19+
"test-util",
20+
] }
21+
yew = { workspace = true, features = ["ssr"] }

packages/yew-style/tests/component.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use yew::ServerRenderer;
12
use yew::prelude::*;
23
use yew_style::Style;
34

@@ -48,3 +49,9 @@ fn App() -> Html {
4849
</Button>
4950
}
5051
}
52+
53+
#[tokio::test]
54+
async fn test() {
55+
let renderer = ServerRenderer::<App>::new();
56+
renderer.render().await;
57+
}

0 commit comments

Comments
 (0)