MCPcopy Create free account
hub / github.com/devspace-sh/devspace / TestReportToString

Function TestReportToString

pkg/devspace/analyze/analyze_test.go:211–239  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

209}
210
211func TestReportToString(t *testing.T) {
212 testCases := []reportToStringTestCase{
213 {
214 name: "No items",
215 expectedString: fmt.Sprintf("\n%sNo problems found.\n%sRun `%s` if you want show pod logs\n\n", paddingLeft, paddingLeft, ansi.Color("devspace logs --pick", "white+b")),
216 },
217 {
218 name: "testReport",
219 report: []*ReportItem{
220 {
221 Name: "testReport",
222 Problems: []string{
223 "Somethings wrong, I guess...",
224 },
225 },
226 },
227 expectedString: `
228` + ansi.Color(` ================================================================================
229 testReport (1 potential issue(s))
230 ================================================================================
231`, "green+b") + "Somethings wrong, I guess...\n",
232 },
233 }
234
235 for _, testCase := range testCases {
236 result := ReportToString(testCase.report)
237 assert.Equal(t, result, testCase.expectedString, "Unexpected result in testCase %s", testCase.name)
238 }
239}

Callers

nothing calls this directly

Calls 2

ReportToStringFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected