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

Function TestEngineStepsToTopLevelCodemod_NoOp

pkg/cli/codemod_engine_steps_test.go:24–83  ·  view source on GitHub ↗

TestEngineStepsToTopLevelCodemod_NoOp tests cases where the codemod should not apply

(t *testing.T)

Source from the content-addressed store, hash-verified

22
23// TestEngineStepsToTopLevelCodemod_NoOp tests cases where the codemod should not apply
24func TestEngineStepsToTopLevelCodemod_NoOp(t *testing.T) {
25 tests := []struct {
26 name string
27 content string
28 frontmatter map[string]any
29 }{
30 {
31 name: "no engine field",
32 content: `---
33on: push
34---
35
36# Test workflow`,
37 frontmatter: map[string]any{
38 "on": "push",
39 },
40 },
41 {
42 name: "engine is a string",
43 content: `---
44on: push
45engine: claude
46---
47
48# Test workflow`,
49 frontmatter: map[string]any{
50 "on": "push",
51 "engine": "claude",
52 },
53 },
54 {
55 name: "engine object without steps",
56 content: `---
57on: push
58engine:
59 id: claude
60 model: claude-3-5-sonnet
61---
62
63# Test workflow`,
64 frontmatter: map[string]any{
65 "on": "push",
66 "engine": map[string]any{
67 "id": "claude",
68 "model": "claude-3-5-sonnet",
69 },
70 },
71 },
72 }
73
74 for _, tt := range tests {
75 t.Run(tt.name, func(t *testing.T) {
76 codemod := getEngineStepsToTopLevelCodemod()
77 result, applied, err := codemod.Apply(tt.content, tt.frontmatter)
78 require.NoError(t, err)
79 assert.False(t, applied, "Should not apply")
80 assert.Equal(t, tt.content, result, "Content should be unchanged")
81 })

Callers

nothing calls this directly

Calls 2

RunMethod · 0.45

Tested by

no test coverage detected