13 unstable releases (3 breaking)

0.4.3 Feb 17, 2020
0.4.2 Jan 6, 2020
0.3.0 Dec 30, 2019
0.2.2 Dec 30, 2019
0.1.4 Dec 29, 2019
Download history 13/week @ 2021-02-20 2/week @ 2021-02-27 48/week @ 2021-03-20 27/week @ 2021-03-27 27/week @ 2021-04-03 17/week @ 2021-04-10 7/week @ 2021-04-17 14/week @ 2021-04-24 14/week @ 2021-05-01 13/week @ 2021-05-15 13/week @ 2021-06-05

65 downloads per month

BSD-2-Clause

12KB
312 lines

nix-test-runner

Simple cli tool to run nix expression tests.

Usage

## my-tests.nix
{
  testFailed = {
    expr = builtins.add 1 1;
    expected = 1;
  };
  testPassed = {
    expr = builtins.add 1 1;
    expected = 2;
  };
}

$ nix-test my-tests.nix

    testFailed

        2
        
         Expect.equal
        
        1


    TEST RUN FAILED

    Duration: 72 ms
    Passed:   1
    Failed:   1
                                    %                                                
~
 

You can get different output formats using --reporter junit|json|human.

This uses lib.debug.runTests under the hood and doesn't change any behaviour of nix, it's merly a wrapper around nix-instantiate.

Dependencies

~3–4MB
~78K SLoC