NixTest: a tiny unit testing framework written in pure nix

Hi all,

As part of the work we’ve been doing with devbox, we needed a unit testing framework to test some of our nix code. Unfortunately we had some use cases where we did not want to introduce a dependency on nixpkgs (and therefore we couldn’t use runTests).

So we ended up writing NixTest: a tiny unit testing framework, written in pure nix. It’s completely self-contained and has no external dependencies (not even to nixpkgs).

Sharing it with the community in case anyone else has a need for a similar unit testing framework.


There are projects which just expose lib nixpkgs.lib/debug.nix at 367c0e1086a4eb4502b24d872cea2c7acdd557f4 · nix-community/nixpkgs.lib · GitHub

1 Like

Notably, there’s also namaka with (in my experience) unprecedented testing productivity levels.

Hosted by Flying Circus.