Skip to content

Commit bc22b90

Browse files
serghei-devsergeyklay
authored andcommitted
test: add nil checks in buildIssueDetail tests
1 parent 8ab8ae9 commit bc22b90

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal/server/handler_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ func TestBuildIssueDetail(t *testing.T) {
285285
got := buildIssueDetail("MT-100", snap)
286286
if got == nil {
287287
t.Fatal("buildIssueDetail(MT-100) = nil, want non-nil")
288+
return
288289
}
289290
if got.Status != "running" {
290291
t.Errorf("Status = %q, want %q", got.Status, "running")
@@ -320,6 +321,7 @@ func TestBuildIssueDetail(t *testing.T) {
320321
got := buildIssueDetail("MT-200", snap)
321322
if got == nil {
322323
t.Fatal("buildIssueDetail(MT-200) = nil, want non-nil")
324+
return
323325
}
324326
if got.Status != "retrying" {
325327
t.Errorf("Status = %q, want %q", got.Status, "retrying")
@@ -365,6 +367,7 @@ func TestBuildIssueDetail(t *testing.T) {
365367
got := buildIssueDetail("MT-300", noWSSnap)
366368
if got == nil {
367369
t.Fatal("buildIssueDetail(MT-300) = nil, want non-nil")
370+
return
368371
}
369372
if got.Workspace != nil {
370373
t.Errorf("Workspace = %v, want nil when WorkspacePath is empty", got.Workspace)
@@ -381,6 +384,7 @@ func TestBuildIssueDetail(t *testing.T) {
381384
got := buildIssueDetail("MT-400", noErrSnap)
382385
if got == nil {
383386
t.Fatal("buildIssueDetail(MT-400) = nil, want non-nil")
387+
return
384388
}
385389
if got.LastError != nil {
386390
t.Errorf("LastError = %v, want nil when Error is empty", got.LastError)

0 commit comments

Comments
 (0)