about summary refs log tree commit diff
path: root/pkgs/tools/networking/lychee/tests/ok.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/lychee/tests/ok.nix')
-rw-r--r--pkgs/tools/networking/lychee/tests/ok.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/tools/networking/lychee/tests/ok.nix b/pkgs/tools/networking/lychee/tests/ok.nix
new file mode 100644
index 0000000000000..6a6c0b9c87b49
--- /dev/null
+++ b/pkgs/tools/networking/lychee/tests/ok.nix
@@ -0,0 +1,12 @@
+{ runCommand, testers }:
+let
+  sitePkg = runCommand "site" { } ''
+    dist=$out/dist
+    mkdir -p $dist
+    echo "<html><body><a href=\"https://example.com/foo.html\">foo</a><a href=\"https://nixos.org/this-is-ignored.html\">bar</a></body></html>" > $dist/index.html
+    echo "<html><body><a href=\".\">index</a></body></html>" > $dist/foo.html
+  '';
+in testers.lycheeLinkCheck rec {
+  site = sitePkg + "/dist";
+  remap = { "https://example.com" = site; };
+}