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

Function TestExport_MissingIndexHTML

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

Source from the content-addressed store, hash-verified

366}
367
368func TestExport_MissingIndexHTML(t *testing.T) {
369 taskDir := createTestTaskDir(t)
370 outDir := filepath.Join(t.TempDir(), "export")
371
372 // FS with static/dist/ directory but no index.html
373 missingIndexFS := fstest.MapFS{
374 "static/dist/assets/app.js": &fstest.MapFile{
375 Data: []byte(`console.log("app")`),
376 },
377 }
378
379 err := ExportWithFS(ExportConfig{
380 OutputDir: outDir,
381 ScanDir: taskDir,
382 BasePath: "/",
383 Version: "test",
384 }, missingIndexFS)
385
386 if err == nil {
387 t.Fatal("expected error when index.html is missing")
388 }
389
390 if !strings.Contains(err.Error(), "no embedded web assets") {
391 t.Errorf("expected 'no embedded web assets' error, got: %v", err)
392 }
393}
394
395func TestExport_CustomOutput(t *testing.T) {
396 taskDir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
ExportWithFSFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected