Upgrading insta 0.16 to 1
Breaking0.16.1 → 1.49.0Breaking10Platform6Deprecated7New66Changed72Fixed76Other13
BreakingUpgrade verdict
10 breaking changes and 6 platform requirement changes.
In plain terms
- To keep using JSON or YAML snapshot assertions, you must now enable the matching feature.
- The force-update flag now rewrites all snapshots and accepts them, so inline snapshot delimiters and indentation get updated too. To keep the old behavior, use the new --require-full-match flag.
- The command line flag for including ignored tests has a new name, so scripts using the old name must be updated.
- The optional backtrace support has been removed from the package.
Must act Top 5 of 23 that need code or config changes
Requires Rust 1.66.0 from 1.47.0 (none stated before).
What you must change
Breaking10
assert_json_snapshot! and assert_yaml_snapshot! now require the json and yaml features respectively.assert_json_snapshot!assert_yaml_snapshot!jsonyamlChanges --force-update-snapshots to write every snapshot and imply --accept; use --require-full-match for the old behavior.
--force-update-snapshots--accept--require-full-matchRenames the --no-ignore option to --include-ignored.
--no-ignore--include-ignoredRemoves the
backtrace feature.backtraceRemoves the
serialization feature.serializationRemoves deprecated
Settings::bind_to_thread.Settings::bind_to_threadDisallows unnamed snapshots in doctests.
Changes snapshot name detection to use function names instead of thread names, altering snapshot names in some cases.
Adds
Send + Sync bounds to the Comparator trait for consistency with Arc-based storage.Comparatorinsta::internals::SettingsBindDropGuard returned from Settings::bind_to_scope no longer implements Send.insta::internals::SettingsBindDropGuardSettings::bind_to_scopeSendPlatform6
Upgrades
console to 0.16 and raises the minimum supported Rust version (MSRV) to 1.66.consoleRaises the MSRV for insta to 1.60 and for cargo-insta to 1.64.
instacargo-instaBumps the minimum supported Rust version to 1.56.1 because the serde-yaml dependency no longer supports older Rust versions.
Bumps
libc to 0.2.174, fixing musl builds, and raises the MSRV of insta to 1.64.0.libcLowers the minimum supported Rust version to 1.41.0.
Bumps the similar dependency to reintroduce support for Rust 1.43.0.
Deprecations to plan for
Deprecated7
Adds a --disable-nextest-doctest flag together with a deprecation warning.
--disable-nextest-doctestHides the
unseen CLI option, which is pending deprecation.unseenDeprecates --no-force-pass in cargo-insta in favor of the clearer --check option.
--no-force-pass--checkDeprecates the INSTA_FORCE_UPDATE_SNAPSHOTS env var in favor of INSTA_FORCE_UPDATE.
INSTA_FORCE_UPDATE_SNAPSHOTSINSTA_FORCE_UPDATEDeprecates the assert_display_snapshot! macro.
assert_display_snapshot!Deprecates unused
serialization features.serializationDeprecates unused
backtrace feature.backtrace