Making snapshot files dependent on a crate feature being enabled #566
Unanswered
bradlarsen
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Would something like this work? #[cfg(feature = "foo")]
let name = "with_foo";
#[cfg(not(feature = "foo"))]
let name = "without_foo";
assert_snapshot!(name, output); Not perfect, but possibly sufficient? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any good way to make Insta's snapshot files dependent on a particular Cargo feature of my crate being enabled?
I have a number of tests that give different output when a particular feature
foo
is enabled or not. I still want to run the tests, but have them use differently-trained snapshot files depending on whetherfoo
is enabled or not.Beta Was this translation helpful? Give feedback.
All reactions