tenseleyflow/shithub / 137671e

Browse files

S39: production-templates smoke — full parse via render.New in CI

Authored by espadonne
SHA
137671ed30032aac91cdda15e0a878508827f6c1
Parents
906a357
Tree
57f253f

1 changed file

StatusFile+-
A internal/web/embed_test.go 25 0
internal/web/embed_test.goadded
@@ -0,0 +1,25 @@
1
+// SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+package web
4
+
5
+import (
6
+	"testing"
7
+
8
+	"github.com/tenseleyFlow/shithub/internal/web/render"
9
+)
10
+
11
+// TestProductionTemplatesParse runs the embedded production templates
12
+// through render.New so any undefined-template ref or unparseable file
13
+// fails CI rather than the binary's first request after deploy.
14
+//
15
+// The check exists in addition to the targeted unit tests in
16
+// internal/web/render/render_test.go: those cover the validator's
17
+// behaviour on synthetic FS trees; this one covers the actual files
18
+// under internal/web/templates/.
19
+func TestProductionTemplatesParse(t *testing.T) {
20
+	t.Parallel()
21
+	_, err := render.New(TemplatesFS(), render.Options{})
22
+	if err != nil {
23
+		t.Fatalf("production templates failed to parse: %v", err)
24
+	}
25
+}