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

Function TestExport_BoardJSON

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

Source from the content-addressed store, hash-verified

156}
157
158func TestExport_BoardJSON(t *testing.T) {
159 taskDir := createTestTaskDir(t)
160 outDir := filepath.Join(t.TempDir(), "export")
161
162 err := exportWithMockFS(t, ExportConfig{
163 OutputDir: outDir,
164 ScanDir: taskDir,
165 BasePath: "/",
166 Version: "test",
167 })
168 if err != nil {
169 t.Fatalf("Export failed: %v", err)
170 }
171
172 groupByValues := []string{"status", "priority", "effort", "type", "group", "tag"}
173 for _, gb := range groupByValues {
174 path := filepath.Join(outDir, "api", "board", gb+".json")
175 data, err := os.ReadFile(path)
176 if err != nil {
177 t.Errorf("failed to read board/%s.json: %v", gb, err)
178 continue
179 }
180
181 var groups []map[string]any
182 if err := json.Unmarshal(data, &groups); err != nil {
183 t.Errorf("invalid JSON in board/%s.json: %v", gb, err)
184 }
185 }
186}
187
188func TestExport_ConfigJSON(t *testing.T) {
189 taskDir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 2

createTestTaskDirFunction · 0.85
exportWithMockFSFunction · 0.85

Tested by

no test coverage detected