Improve test coverage

This commit is contained in:
Dan Jones 2025-01-27 11:41:32 -06:00
commit d7de194a90
4 changed files with 75 additions and 0 deletions

View file

@ -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)
}