Plurrrr

Sat 03 Sep 2022

Unit Test Your Nix Code

At Tweag, we write a lot of code using the Nix language. Most of that code produces derivations or packages but occasionally we write small helper functions that are algorithmic in nature. As diligent developers and when appropriate, we should write unit tests to ensure the correctness and maintainability of our code. This post will demonstrate and compare various ways available in the Nix ecosystem to add unit testing to your Nix code — specifically Nix functions.

Source: Unit Test Your Nix Code, an article by Daniel Baker.