tix/test/test.test.nix

32 lines
649 B
Nix
Raw Normal View History

2024-01-02 13:15:50 +00:00
{
describe,
it,
...
}: let
2024-01-02 12:44:07 +00:00
test = import ../tix/test.nix;
2024-01-03 10:14:28 +00:00
in [
(describe "the test function" [
2024-01-02 13:15:50 +00:00
(it "get's test results" {
2024-01-03 19:18:54 +00:00
expected = {
name = builtins.baseNameOf ./example.test.nix;
2024-01-03 19:18:54 +00:00
value = {
"an example" = {
succeeds = {
success = true;
};
};
};
};
actual = test ./example.test.nix;
2024-01-02 13:15:50 +00:00
})
(it "fails to build non test" {
actual = test ./bad/string.nix;
throws = true;
})
(it "tests suite that is not a file" {
actual = test ({...}: []);
expected = {name = "anonymous"; value = {};};
})
2024-01-03 10:14:28 +00:00
])
]