✅ Improve test coverage
This commit is contained in:
parent
6f06adc37d
commit
d7de194a90
4 changed files with 75 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package store
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
|
@ -92,3 +93,13 @@ func TestMakeStoreNoName(t *testing.T) {
|
|||
assert.NotNil(t, s)
|
||||
assert.NoError(t, e)
|
||||
}
|
||||
|
||||
func TestMakeStoreConfError(t *testing.T) {
|
||||
th := setupFactoryTest(t)
|
||||
mockError := errors.New("leave me alone")
|
||||
th.conf.EXPECT().Store("mock").Return(nil, mockError)
|
||||
s, e := MakeStore("mock", th.conf)
|
||||
assert.Zero(t, s)
|
||||
assert.ErrorIs(t, e, mockError)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue