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

Function TestExport_OutputStructure

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

Source from the content-addressed store, hash-verified

47}
48
49func TestExport_OutputStructure(t *testing.T) {
50 taskDir := createTestTaskDir(t)
51 outDir := filepath.Join(t.TempDir(), "export")
52
53 err := exportWithMockFS(t, ExportConfig{
54 OutputDir: outDir,
55 ScanDir: taskDir,
56 BasePath: "/",
57 Version: "test-1.0.0",
58 })
59 if err != nil {
60 t.Fatalf("Export failed: %v", err)
61 }
62
63 // Check core files exist
64 expected := []string{
65 "index.html",
66 "404.html",
67 "assets/index-abc123.js",
68 "assets/index-abc123.css",
69 "api/config.json",
70 "api/tasks.json",
71 "api/tasks/001.json",
72 "api/tasks/002.json",
73 "api/tasks/001/worklog.json",
74 "api/tasks/002/worklog.json",
75 "api/board/status.json",
76 "api/board/priority.json",
77 "api/board/effort.json",
78 "api/board/type.json",
79 "api/board/group.json",
80 "api/board/tag.json",
81 "api/graph.json",
82 "api/stats.json",
83 "api/next.json",
84 "api/tracks.json",
85 "api/validate.json",
86 }
87
88 for _, f := range expected {
89 path := filepath.Join(outDir, f)
90 if _, err := os.Stat(path); err != nil {
91 t.Errorf("expected file %s to exist: %v", f, err)
92 }
93 }
94}
95
96func TestExport_TasksJSON(t *testing.T) {
97 taskDir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 2

createTestTaskDirFunction · 0.85
exportWithMockFSFunction · 0.85

Tested by

no test coverage detected