aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/testhelpers_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-02-26 10:06:04 +0100
committerBjørn Erik Pedersen <[email protected]>2020-02-27 11:47:24 +0100
commitb66d38c41939252649365822d9edb10cf5990617 (patch)
treea58b900180aff71edc36ed040f7e184f44cfc724 /hugolib/testhelpers_test.go
parent05a74eaec0d944a4b29445c878a431cd6ae12277 (diff)
downloadhugo-b66d38c41939252649365822d9edb10cf5990617.tar.gz
hugo-b66d38c41939252649365822d9edb10cf5990617.zip
resources: Add basic @import support to resources.PostCSS
This commit also makes the HUGO_ENVIRONMENT environment variable available to Node. Fixes #6957 Fixes #6961
Diffstat (limited to 'hugolib/testhelpers_test.go')
-rw-r--r--hugolib/testhelpers_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go
index ac6fe4348..fe6f3b7e3 100644
--- a/hugolib/testhelpers_test.go
+++ b/hugolib/testhelpers_test.go
@@ -1039,3 +1039,18 @@ func skipSymlink(t *testing.T) {
}
}
+
+func captureStderr(f func() error) (string, error) {
+ old := os.Stderr
+ r, w, _ := os.Pipe()
+ os.Stderr = w
+
+ err := f()
+
+ w.Close()
+ os.Stderr = old
+
+ var buf bytes.Buffer
+ io.Copy(&buf, r)
+ return buf.String(), err
+}