1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
4 nodes.machine = { config, lib, pkgs, ... }: {
7 additionalModules = [ pkgs.nginxModules.njs ];
9 js_import http from ${builtins.toFile "http.js" ''
11 r.return(200, "Hello world!");
13 export default {hello};
16 virtualHosts."localhost".locations."/".extraConfig = ''
17 js_content http.hello;
22 machine.wait_for_unit("nginx")
24 response = machine.wait_until_succeeds("curl -fvvv -s http://127.0.0.1/")
25 assert "Hello world!" == response, f"Expected 'Hello world!', got '{response}'"