(t *testing.T)
| 366 | } |
| 367 | |
| 368 | func 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 | |
| 395 | func TestExport_CustomOutput(t *testing.T) { |
| 396 | taskDir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected