{ pkgs, mkJekyllSite }: let mkTest = name: content: test: let testDir = pkgs.runCommand "test-env-${name}" {} '' mkdir -p $out cat > $out/index.html < $out/_config.yml <Test Page" (site: '' test -f ${site}/index.html || (echo "Missing index.html" && exit 1) grep -q "

Test Page

" ${site}/index.html ''); minification = mkTest "minify" "

Test

" (site: '' ! grep -q " " ${site}/index.html || (echo "Not minified" && exit 1) ''); }; in { checks = tests; apps.test = { type = "app"; program = "${pkgs.writeScriptBin "run-tests" '' #!${pkgs.bash}/bin/bash set -euo pipefail ${builtins.concatStringsSep "\n" (map (name: "echo Testing ${name}... && test -e ${tests.${name}}") (builtins.attrNames tests))} echo "All tests passed!" ''}/bin/run-tests"; }; }