You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if users of a library could use faux to export mocked versions of their public API.
The problem is that items wrapped by #[cfg(test)] are intentionally not propagated through crates. Which means that any mocks created with the test flag are not lost when the crate is being used as a dependency.
Once we figure out a workaround for this we should document it (perhaps a mini guide?) on how to do it.
The text was updated successfully, but these errors were encountered:
# crate-b
[dependencies]
crate-a = { version = "1.0" }
[dev-dependencies]
crate-a = { version = "1.0", features = exposed-mocks }
crate-b should now be able to use the mocks created by crate-a as long as the mocks are gated such as:
#[cfg(any(test,exposed-mocks))]#[faux::create]pubstructMyPublicStruct{/* fields go here */}#[cfg(any(test,exposed-mocks))]#[faux::methods]implMyPublicStruct{/* methods go here */}
It would be great if users of a library could use
faux
to export mocked versions of their public API.The problem is that items wrapped by
#[cfg(test)]
are intentionally not propagated through crates. Which means that any mocks created with the test flag are not lost when the crate is being used as a dependency.Once we figure out a workaround for this we should document it (perhaps a mini guide?) on how to do it.
The text was updated successfully, but these errors were encountered: