Auto-updating snapshot testing utilities for Elixir that integrate with ExUnit.
Mneme is an Elixir testing library that enhances ExUnit with auto-updating snapshot assertions. It automatically generates and updates expected values in tests when code behavior changes, streamlining test maintenance by reducing manual assertion updates.
Elixir developers who write ExUnit tests and want to reduce the manual effort of updating test assertions during development, particularly those working on projects with frequently changing behavior.
Developers choose Mneme because it integrates seamlessly with existing ExUnit workflows while providing interactive prompts to accept or reject assertion updates, making test maintenance more efficient and less error-prone compared to manually updating assertions.
Snapshot testing for Elixir
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically generates and updates test patterns when code behavior changes, reducing manual maintenance. Evidence: The README shows how `auto_assert` updates to include expected values like `auto_assert 4 <- 2 + 2` after user confirmation.
Works with existing ExUnit workflows without requiring changes to test runners. Evidence: The README states you can simply `use Mneme` in test cases and run `mix test` as usual.
Provides terminal prompts to accept, reject, or skip assertion updates, making test maintenance interactive. Evidence: The README includes a CLI screenshot and describes key bindings like 'y' for accept and 'n' for reject.
Highlights meaningful changes in values with intelligent diffing for easier review. Evidence: The README lists this as a key feature to help developers understand what changed.
Requires a formatter to avoid reformatting entire files, which can introduce unrelated changes and complicate setups. Evidence: The README warns that without a formatter, the first auto-assertion reformats the whole file.
In CI, prompts are disabled and tests fail instead of updating, potentially breaking builds without manual fixes. Evidence: The README states Mneme fails tests in CI environments where the `CI` variable is set, limiting automation.
Requires Elixir 1.14 or later, restricting compatibility with older projects and ecosystems. Evidence: The README explicitly lists this as a requirement under 'Elixir'.