(t *testing.T)
| 186 | } |
| 187 | |
| 188 | func TestExport_ConfigJSON(t *testing.T) { |
| 189 | taskDir := createTestTaskDir(t) |
| 190 | outDir := filepath.Join(t.TempDir(), "export") |
| 191 | |
| 192 | err := exportWithMockFS(t, ExportConfig{ |
| 193 | OutputDir: outDir, |
| 194 | ScanDir: taskDir, |
| 195 | BasePath: "/", |
| 196 | Version: "test-1.0.0", |
| 197 | }) |
| 198 | if err != nil { |
| 199 | t.Fatalf("Export failed: %v", err) |
| 200 | } |
| 201 | |
| 202 | data, err := os.ReadFile(filepath.Join(outDir, "api", "config.json")) |
| 203 | if err != nil { |
| 204 | t.Fatalf("failed to read config.json: %v", err) |
| 205 | } |
| 206 | |
| 207 | var config ConfigResponse |
| 208 | if err := json.Unmarshal(data, &config); err != nil { |
| 209 | t.Fatalf("invalid JSON in config.json: %v", err) |
| 210 | } |
| 211 | |
| 212 | if !config.ReadOnly { |
| 213 | t.Error("expected readonly to be true in exported config") |
| 214 | } |
| 215 | |
| 216 | if config.Version != "test-1.0.0" { |
| 217 | t.Errorf("expected version 'test-1.0.0', got %q", config.Version) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | func TestExport_IndexHTML_FetchInterceptor(t *testing.T) { |
| 222 | taskDir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected