package settings import ( "testing" "github.com/stretchr/testify/assert" ) func TestSettingsLoading(t *testing.T) { const file string = `{ "endpoint": "0.0.0.0:8000", "token": "foobar", "storageProvider": { "type": 0, "basePath": "assets" } }` t.Run("Settings parsing is successful", func(t *testing.T) { settings := parseSettings([]byte(file)) assert.Equal(t, "0.0.0.0:8000", settings.Endpoint) assert.Equal(t, "foobar", settings.Token) assert.Equal(t, "assets", settings.StorageProvider.BasePath) }) }