Skip to content

Commit

Permalink
Fail MUO test if we expect an error but don't get one
Browse files Browse the repository at this point in the history
  • Loading branch information
bennerv committed Apr 19, 2022
1 parent 6495779 commit 5a79d8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/operator/controllers/muo/muo_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ func TestMUOReconciler(t *testing.T) {
readinessPollTime: 1 * time.Second,
}
_, err := r.Reconcile(context.Background(), reconcile.Request{})
if err != nil && err.Error() != tt.wantErr {
t.Errorf("got error '%v', wanted error '%v'", err, tt.wantErr)
}

if err == nil && tt.wantErr != "" {
t.Error(err)
} else if err != nil {
if err.Error() != tt.wantErr {
t.Errorf("wanted '%v', got '%v'", tt.wantErr, err)
}
t.Errorf("did not get an error, but wanted error '%v'", tt.wantErr)
}
})
}
Expand Down

0 comments on commit 5a79d8f

Please sign in to comment.