Files
tasklist/test/test.nix
2023-10-05 19:10:37 +02:00

22 lines
653 B
Nix

# ./tests/hello-world-server.nix
(import ./lib.nix) {
name = "from-nixos";
nodes = {
# `self` here is set by using specialArgs in `lib.nix`
node1 = { self, pkgs, ... }: {
imports = [ self.nixosModules.malobeo-tasklist ];
services.malobeo-tasklist.enable = true;
environment.systemPackages = [ pkgs.curl ];
};
};
testScript = ''
start_all() # wait for our service to start
node1.wait_for_unit("malobeo-tasklist")
output = node1.succeed("curl localhost:8080")
# Check if our webserver returns the expected result
assert "tasklist" in output, f"'{output}' does not contain 'Hello world'"
'';
}