MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / TestCLIAvailableVariables

Function TestCLIAvailableVariables

render/variables_test.go:80–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

78}
79
80func TestCLIAvailableVariables(t *testing.T) {
81 result := api.CLICommandResult{
82 Variables: map[string]string{
83 "url": "http://localhost:42069",
84 },
85 Command: api.CLIStepCLICommand{
86 Command: "curl ${url}",
87 Tests: []api.CLICommandTest{
88 {StdoutContainsAll: []string{"${expected}"}},
89 },
90 },
91 }
92
93 available, expectsVariables := availableVariablesForCLIResult(result)
94 if !expectsVariables {
95 t.Fatalf("expected CLI command to use variables")
96 }
97 got := renderVariableSection("Variables Available", available)
98
99 if !strings.Contains(got, "url: http://localhost:42069 (Command)") {
100 t.Fatalf("expected url entry in:\n%s", got)
101 }
102 if !strings.Contains(got, "expected: [not found] (Stdout Contains Test)") {
103 t.Fatalf("expected missing expected entry in:\n%s", got)
104 }
105}

Callers

nothing calls this directly

Calls 2

renderVariableSectionFunction · 0.85

Tested by

no test coverage detected