MCPcopy Create free account
hub / github.com/github/gh-aw / TestGetAllCodemods

Function TestGetAllCodemods

pkg/cli/fix_command_test.go:479–517  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

477}
478
479func 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
519func TestNewFixCommand_HasDisableCodemodFlag(t *testing.T) {
520 cmd := NewFixCommand()

Callers

nothing calls this directly

Calls 3

GetAllCodemodsFunction · 0.85
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected