From 1fb12a98ea8afcf4dc7a1bf1b4b3a2da8b2d3b4a Mon Sep 17 00:00:00 2001 From: nate smith Date: Wed, 29 Mar 2023 06:25:35 -0700 Subject: [PATCH] improve test resiliency --- pkg/cmd/run/list/list_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/run/list/list_test.go b/pkg/cmd/run/list/list_test.go index 96a9ab912..d33af7167 100644 --- a/pkg/cmd/run/list/list_test.go +++ b/pkg/cmd/run/list/list_test.go @@ -123,6 +123,7 @@ func TestListRun(t *testing.T) { wantErr bool wantOut string wantErrOut string + wantErrMsg string stubs func(*httpmock.Registry) isTTY bool }{ @@ -343,7 +344,8 @@ func TestListRun(t *testing.T) { httpmock.JSONResponse(shared.RunsPayload{}), ) }, - wantErr: true, + wantErr: true, + wantErrMsg: "no runs found", }, { name: "workflow selector", @@ -384,7 +386,8 @@ func TestListRun(t *testing.T) { httpmock.JSONResponse(shared.RunsPayload{}), ) }, - wantErr: true, + wantErr: true, + wantErrMsg: "no runs found", }, { name: "actor filter applied", @@ -400,7 +403,8 @@ func TestListRun(t *testing.T) { httpmock.JSONResponse(shared.RunsPayload{}), ) }, - wantErr: true, + wantErr: true, + wantErrMsg: "no runs found", }, { name: "status filter applied", @@ -417,7 +421,8 @@ func TestListRun(t *testing.T) { httpmock.JSONResponse(shared.RunsPayload{}), ) }, - wantErr: true, + wantErr: true, + wantErrMsg: "no runs found", }, } @@ -441,6 +446,7 @@ func TestListRun(t *testing.T) { err := listRun(tt.opts) if tt.wantErr { assert.Error(t, err) + assert.Equal(t, tt.wantErrMsg, err.Error()) } else { assert.NoError(t, err) }