config_test.go: add test for no ORIGIN

This commit is contained in:
Adhityaa 2018-06-09 14:03:06 +05:30
parent 37e772b595
commit c208e3392b

View File

@ -33,6 +33,15 @@ func TestParseConfigBasics(t *testing.T) {
} }
} }
func TestParseConfigNoOrigin(t *testing.T) {
os.Setenv("COMMENTO_ORIGIN", "")
if err := parseConfig(); err == nil {
t.Errorf("expected error not found parsing config without ORIGIN")
return
}
}
func TestParseConfigStatic(t *testing.T) { func TestParseConfigStatic(t *testing.T) {
os.Setenv("COMMENTO_ORIGIN", "https://commento.io") os.Setenv("COMMENTO_ORIGIN", "https://commento.io")