update test error lint

This commit is contained in:
Jonathan Gimeno 2020-02-27 16:33:30 +01:00
parent 0a3fcf6d2d
commit a21a7faebc
2 changed files with 13 additions and 8 deletions

View File

@ -42,6 +42,7 @@ func TestGetPruningOptionsFromFlags(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(j *testing.T) {
tt := tt
viper.Reset()
tt.initParams()
require.Equal(t, tt.expectedOptions, GetPruningOptionsFromFlags())

View File

@ -86,15 +86,19 @@ func TestPruningOptions(t *testing.T) {
}
for _, tt := range tests {
viper.Reset()
tt.paramInit()
t.Run(tt.name, func(t *testing.T) {
tt := tt
err := startCommand.PreRunE(nil, nil)
viper.Reset()
tt.paramInit()
if tt.returnsErr {
require.EqualError(t, err, tt.expectedErr.Error())
} else {
require.NoError(t, err)
}
err := startCommand.PreRunE(nil, nil)
if tt.returnsErr {
require.EqualError(t, err, tt.expectedErr.Error())
} else {
require.NoError(t, err)
}
})
}
}