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", "fileSystem": { "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.FileSystem.BasePath) }) }