Enum term_transcript::test::UpdateMode [−][src]
#[non_exhaustive]
pub enum UpdateMode {
Never,
Always,
}This is supported on crate features
test and svg only.Expand description
Strategy for saving a new snapshot on a test failure within TestConfig::test() and
related methods.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Never
Never create a new snapshot on test failure.
Always
Always create a new snapshot on test failure.
Implementations
Reads the update mode from the TERM_TRANSCRIPT_UPDATE env variable.
If the TERM_TRANSCRIPT_UPDATE variable is not set, the output depends on whether
the executable is running in CI (which is detected by the presence of
the CI env variable):
- In CI, the method returns
Self::Never. - Otherwise, the method returns
Self::Always.
Panics
If the TERM_TRANSCRIPT_UPDATE env variable is set to an unrecognized value
(something other than never or always), this method will panic.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for UpdateMode
impl Send for UpdateMode
impl Sync for UpdateMode
impl Unpin for UpdateMode
impl UnwindSafe for UpdateMode
Blanket Implementations
Mutably borrows from an owned value. Read more
