2021-12-18 07:15:31 -08:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2021-12-19 11:56:00 -08:00
|
|
|
"github.com/stretchr/testify/assert"
|
2021-12-18 07:15:31 -08:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetConfig(t *testing.T) {
|
|
|
|
_, err := GetConfig()
|
|
|
|
require.NoError(t, err)
|
2021-12-19 11:56:00 -08:00
|
|
|
|
2022-02-10 05:56:07 -08:00
|
|
|
var env environment
|
2021-12-19 11:56:00 -08:00
|
|
|
env = "abc"
|
|
|
|
SwitchEnvironment(env)
|
|
|
|
cfg, err := GetConfig()
|
|
|
|
require.NoError(t, err)
|
|
|
|
assert.Equal(t, env, cfg.App.Environment)
|
2021-12-18 07:15:31 -08:00
|
|
|
}
|