Skip to content

Commit 35be9a0

Browse files
committed
linter fixes
1 parent 28672a4 commit 35be9a0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tools/wasp-cli/cmd/test/harness.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package test provides a testing harness and helpers for wasp-cli command tests.
12
package test
23

34
import (
@@ -132,7 +133,7 @@ func (h *TestHarness) RunCommand(args ...string) (string, error) {
132133
stderr := strings.TrimSpace(h.stderr.String())
133134

134135
// Combine stdout and stderr for output
135-
output := strings.TrimSpace(strings.Join([]string{stdout, stderr}, "\n"))
136+
output := strings.TrimSpace(stdout + "\n" + stderr)
136137
output = strings.Trim(output, "\n ")
137138

138139
// If JSON flags are present, format output similar to production behavior
@@ -197,7 +198,9 @@ func (h *TestHarness) SetupTestConfig() {
197198

198199
// CleanupTestConfig cleans up test configuration
199200
func (h *TestHarness) CleanupTestConfig() {
200-
os.Unsetenv("WASP_CLI_TEST_MODE")
201+
if err := os.Unsetenv("WASP_CLI_TEST_MODE"); err != nil {
202+
require.NoError(h.t, err, "failed to unset WASP_CLI_TEST_MODE")
203+
}
201204
}
202205

203206
// AssertOutputContains checks that the output contains the expected string
@@ -345,8 +348,8 @@ func (h *TestHarness) AssertPrettyJSON(output string) {
345348

346349
// RunCommandWithJSON runs a command with the --json flag
347350
func (h *TestHarness) RunCommandWithJSON(args ...string) (string, error) {
348-
jsonArgs := append(args, "--json")
349-
return h.RunCommand(jsonArgs...)
351+
args = append(args, "--json")
352+
return h.RunCommand(args...)
350353
}
351354

352355
// MustRunCommandWithJSON runs a command with the --json flag and requires it to succeed
@@ -358,8 +361,8 @@ func (h *TestHarness) MustRunCommandWithJSON(args ...string) string {
358361

359362
// RunCommandWithJSONCompact runs a command with the --json-compact flag
360363
func (h *TestHarness) RunCommandWithJSONCompact(args ...string) (string, error) {
361-
jsonArgs := append(args, "--json-compact")
362-
return h.RunCommand(jsonArgs...)
364+
args = append(args, "--json-compact")
365+
return h.RunCommand(args...)
363366
}
364367

365368
// MustRunCommandWithJSONCompact runs a command with the --json-compact flag and requires it to succeed

0 commit comments

Comments
 (0)