mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Allow import of layout_test into 3rd party crates (#3463)
* Expose layout tests Currently I can't import tests because `cfg(test)` isn't sent to sub-dependencies. This allows you to set a `yew/test` and import into your own tests. * Update Cargo.toml * Update lib.rs * Update lib.rs * Update lib.rs * AnyScope::test needs feature = test cfg + fmt --------- Co-authored-by: Elina <imelina@elina.website>
This commit is contained in:
parent
a80542fd49
commit
4025fa75f9
@ -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
|
||||
|
||||
@ -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::<()>(),
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user