diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index eff40aec451..646acc52023 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -96,6 +96,7 @@ ssr = ["dep:html-escape", "dep:base64ct", "dep:bincode"] csr = [] hydration = ["csr", "dep:bincode"] default = [] +test = [] [package.metadata.docs.rs] all-features = true diff --git a/packages/yew/src/html/component/scope.rs b/packages/yew/src/html/component/scope.rs index 9253228fa2e..952978e944f 100644 --- a/packages/yew/src/html/component/scope.rs +++ b/packages/yew/src/html/component/scope.rs @@ -513,7 +513,7 @@ mod feat_csr { use crate::scheduler; impl AnyScope { - #[cfg(test)] + #[cfg(any(test, feature = "test"))] pub(crate) fn test() -> Self { Self { type_id: TypeId::of::<()>(), diff --git a/packages/yew/src/lib.rs b/packages/yew/src/lib.rs index 8e0fda8aefd..44918b4f108 100644 --- a/packages/yew/src/lib.rs +++ b/packages/yew/src/lib.rs @@ -293,8 +293,7 @@ mod app_handle; #[cfg(feature = "csr")] mod renderer; -#[cfg(feature = "csr")] -#[cfg(test)] +#[cfg(all(feature = "csr", any(test, feature = "test")))] #[allow(missing_docs)] pub mod tests;