From c208e3392b31a399774a7a9ae2a40a6e545388df Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Sat, 9 Jun 2018 14:03:06 +0530 Subject: [PATCH] config_test.go: add test for no ORIGIN --- api/config_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/config_test.go b/api/config_test.go index 0bfb378..ea15387 100644 --- a/api/config_test.go +++ b/api/config_test.go @@ -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) { os.Setenv("COMMENTO_ORIGIN", "https://commento.io")