From b66d38c41939252649365822d9edb10cf5990617 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 26 Feb 2020 10:06:04 +0100 Subject: resources: Add basic @import support to resources.PostCSS This commit also makes the HUGO_ENVIRONMENT environment variable available to Node. Fixes #6957 Fixes #6961 --- hugolib/testhelpers_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'hugolib/testhelpers_test.go') 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 +} -- cgit v1.2.3