nix-test-runner

Crates.ionix-test-runner
lib.rsnix-test-runner
version0.4.3
sourcesrc
created_at2019-12-28 12:56:00.947148
updated_at2020-02-17 09:38:07.947908
descriptionCli for running nix expression tests
homepage
repositoryhttps://github.com/stoeffel/nix-test-runner
max_upload_size
id192936
size36,293
Peter Kolloch (kolloch)

documentation

README

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.

Commit count: 59

cargo fmt