Cargo Features

insta = { version = "1.34.0", default-features = false, features = ["redactions", "filters", "glob", "colors", "csv", "json", "ron", "toml", "yaml"] }
default = colors

The colors feature is set by default whenever insta is added without default-features = false somewhere in the dependency tree.

redactions = pest, pest_derive, serde

when the redactions feature is enabled values can be redacted in serialized snapshots.

Affects serialization::serialize_value_redacted, settings::Redactions, settings::ActualSettings.redactions

filters = regex

Enables support for running filters on snapshot

Affects settings::ActualSettings.filters

glob = globset, walkdir

Glob support

Affects settings::ActualSettings.allow_empty_glob

colors default = console

Color support

csv = dep_csv, serde

Serialization formats
TODO: This could be cleaner by using "dep:csv" without renaming the dep, but this technique allows for a lower MSRV

json = serde
ron = dep_ron, serde
toml = dep_toml, serde
yaml = serde

internal feature exclusive to cargo-insta

Affects env::TestRunner, env::UnreferencedSnapshots

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

dep_csv csv?

Enables csv =1.1.6

console colors
pest redactions?

With default features

pest_derive redactions?

With default (std)

dep_ron ron?

Enables ron ^0.7.1

dep_toml toml?

Enables toml ^0.5.7

globset glob?

With default (log)

walkdir glob?
regex filters?

With std and unicode

serde csv? json? redactions? ron? toml? yaml?

With default (std)