MCPcopy Create free account
hub / github.com/driangle/taskmd / TestExport_IndexHTML_BasePath

Function TestExport_IndexHTML_BasePath

apps/cli/internal/web/export_test.go:260–284  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func TestExport_IndexHTML_BasePath(t *testing.T) {
261 taskDir := createTestTaskDir(t)
262 outDir := filepath.Join(t.TempDir(), "export")
263
264 err := exportWithMockFS(t, ExportConfig{
265 OutputDir: outDir,
266 ScanDir: taskDir,
267 BasePath: "/demo/",
268 Version: "test",
269 })
270 if err != nil {
271 t.Fatalf("Export failed: %v", err)
272 }
273
274 data, err := os.ReadFile(filepath.Join(outDir, "index.html"))
275 if err != nil {
276 t.Fatalf("failed to read index.html: %v", err)
277 }
278
279 html := string(data)
280
281 if !strings.Contains(html, `<base href="/demo/">`) {
282 t.Error("expected <base> tag with /demo/ in index.html")
283 }
284}
285
286func TestExport_IndexHTML_BasePathRoot(t *testing.T) {
287 taskDir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
exportWithMockFSFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected