(t *testing.T)
| 477 | } |
| 478 | |
| 479 | func TestGetAllCodemods(t *testing.T) { |
| 480 | codemods := GetAllCodemods() |
| 481 | |
| 482 | if len(codemods) == 0 { |
| 483 | t.Fatal("Expected at least one codemod, got none") |
| 484 | } |
| 485 | // Check for required codemods |
| 486 | expectedIDs := []string{ |
| 487 | "timeout-minutes-migration", |
| 488 | "network-firewall-migration", |
| 489 | "command-to-slash-command-migration", |
| 490 | "mcp-scripts-mode-removal", |
| 491 | } |
| 492 | |
| 493 | foundIDs := make(map[string]bool) |
| 494 | for _, cm := range codemods { |
| 495 | foundIDs[cm.ID] = true |
| 496 | |
| 497 | // Verify each codemod has required fields |
| 498 | if cm.ID == "" { |
| 499 | t.Error("Codemod has empty ID") |
| 500 | } |
| 501 | if cm.Name == "" { |
| 502 | t.Error("Codemod has empty Name") |
| 503 | } |
| 504 | if cm.Description == "" { |
| 505 | t.Error("Codemod has empty Description") |
| 506 | } |
| 507 | if cm.Apply == nil { |
| 508 | t.Error("Codemod has nil Apply function") |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | for _, expectedID := range expectedIDs { |
| 513 | if !foundIDs[expectedID] { |
| 514 | t.Errorf("Expected codemod with ID %s not found", expectedID) |
| 515 | } |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | func TestNewFixCommand_HasDisableCodemodFlag(t *testing.T) { |
| 520 | cmd := NewFixCommand() |
nothing calls this directly
no test coverage detected