A snapshot testing tool for Nix that automatically generates and manages test reference values.
Namaka is a snapshot testing tool built for the Nix language and ecosystem. It allows developers to test Nix expressions by automatically generating and comparing snapshots of their outputs, simplifying the creation and maintenance of tests for Nix configurations, packages, and modules. It integrates with Nix Flakes and provides commands to check, review, and clean snapshots.
Nix developers and maintainers who need to write and maintain tests for Nix expressions, packages, or configurations, particularly those using Nix Flakes in their projects.
Developers choose Namaka because it eliminates the manual effort of writing expected values in tests, provides a smooth review workflow for snapshot updates, and integrates natively with Nix tooling like `nix flake check`, making it a specialized and efficient testing solution for the Nix ecosystem.
Snapshot testing for Nix based on haumea [maintainer=@figsoda]
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 captures and stores Nix expression outputs as snapshots, eliminating manual assertion writing, as highlighted in the Snapshot Testing section.
Wraps `nix flake check` to prepare snapshots for failed tests, seamlessly fitting into existing Nix workflows, per the Integration with Nix Flakes feature.
Supports multiple output formats like JSON, pretty-printed Nix, and raw strings via optional format.nix files, allowing customization for test outputs.
Provides a `namaka review` command to interactively accept or reject pending snapshot changes, making updates safe and controlled, as described in the Review Workflow.
The README explicitly warns that breaking changes can happen in the main branch at any time, forcing users to pin to specific tags and adding maintenance overhead.
It's tightly coupled to Nix and Nix Flakes, making it ineffective for non-Nix projects and requiring familiarity with Nix tooling, which can be a barrier for newcomers.
Generates snapshot files that must be stored and versioned, which can become unwieldy in large projects with many tests, increasing repository size and complexity.