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

Function TestExport_IndexHTML_BasePathRoot

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

Source from the content-addressed store, hash-verified

284}
285
286func TestExport_IndexHTML_BasePathRoot(t *testing.T) {
287 taskDir := createTestTaskDir(t)
288 outDir := filepath.Join(t.TempDir(), "export")
289
290 err := exportWithMockFS(t, ExportConfig{
291 OutputDir: outDir,
292 ScanDir: taskDir,
293 BasePath: "/",
294 Version: "test",
295 })
296 if err != nil {
297 t.Fatalf("Export failed: %v", err)
298 }
299
300 data, err := os.ReadFile(filepath.Join(outDir, "index.html"))
301 if err != nil {
302 t.Fatalf("failed to read index.html: %v", err)
303 }
304
305 if !strings.Contains(string(data), `<base href="/">`) {
306 t.Error("expected <base href=\"/\"> tag for root base-path")
307 }
308}
309
310func TestExport_SPARouteFiles(t *testing.T) {
311 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