summaryrefslogtreecommitdiffstats
path: root/commands/server_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/server_test.go')
-rw-r--r--commands/server_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/commands/server_test.go b/commands/server_test.go
index 72d81d70d..438837a90 100644
--- a/commands/server_test.go
+++ b/commands/server_test.go
@@ -18,6 +18,7 @@ import (
"net/http"
"os"
"runtime"
+ "strings"
"testing"
"time"
@@ -113,6 +114,18 @@ func TestFixURL(t *testing.T) {
}
}
+func TestRemoveErrorPrefixFromLog(t *testing.T) {
+ assert := require.New(t)
+ content := `ERROR 2018/10/07 13:11:12 Error while rendering "home": template: _default/baseof.html:4:3: executing "main" at <partial "logo" .>: error calling partial: template: partials/logo.html:5:84: executing "partials/logo.html" at <$resized.AHeight>: can't evaluate field AHeight in type *resource.Image
+ERROR 2018/10/07 13:11:12 Rebuild failed: logged 1 error(s)
+`
+
+ withoutError := removeErrorPrefixFromLog(content)
+
+ assert.False(strings.Contains(withoutError, "ERROR"), withoutError)
+
+}
+
func isWindowsCI() bool {
return runtime.GOOS == "windows" && os.Getenv("CI") != ""
}