1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-14 11:58:04 +00:00

add test for invalid port in config file

This commit is contained in:
Michael Engelhardt 2020-11-19 20:03:30 +01:00
parent 10310cf380
commit 4c151bdf8f

View file

@ -219,6 +219,23 @@ services:
} }
} }
func TestParseAndValidateConfigBytesWithInvalidPort(t *testing.T) {
defer func() { recover() }()
parseAndValidateConfigBytes([]byte(`
web:
port: 65536
address: 127.0.0.1
services:
- name: twinnation
url: https://twinnation.org/actuator/health
conditions:
- "[STATUS] == 200"
`))
t.Fatal("Should've panicked because the configuration specifies an invalid port value")
}
func TestParseAndValidateConfigBytesWithMetrics(t *testing.T) { func TestParseAndValidateConfigBytesWithMetrics(t *testing.T) {
config, err := parseAndValidateConfigBytes([]byte(` config, err := parseAndValidateConfigBytes([]byte(`
metrics: true metrics: true