Crates.io | nix-test-runner |
lib.rs | nix-test-runner |
version | 0.4.3 |
source | src |
created_at | 2019-12-28 12:56:00.947148 |
updated_at | 2020-02-17 09:38:07.947908 |
description | Cli for running nix expression tests |
homepage | |
repository | https://github.com/stoeffel/nix-test-runner |
max_upload_size | |
id | 192936 |
size | 36,293 |
Simple cli tool to run nix expression tests.
## 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
.