Skip to content

Commit a8e908a

Browse files
committed
actually print the diff
1 parent 55130f7 commit a8e908a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cli/clitest/golden.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/google/go-cmp/cmp"
1515
"github.com/google/uuid"
16+
"github.com/stretchr/testify/assert"
1617
"github.com/stretchr/testify/require"
1718

1819
"github.com/coder/coder/v2/cli/config"
@@ -118,9 +119,7 @@ func TestGoldenFile(t *testing.T, fileName string, actual []byte, replacements m
118119
require.NoError(t, err, "read golden file, run \"make gen/golden-files\" and commit the changes")
119120

120121
expected = normalizeGoldenFile(t, expected)
121-
if diff := cmp.Diff(string(expected), string(actual)); diff != "" {
122-
t.Fatalf("golden file mismatch: %s, run \"make gen/golden-files\", verify and commit the changes", goldenPath)
123-
}
122+
assert.Empty(t, cmp.Diff(string(expected), string(actual)), "golden file mismatch (-want +got): %s, run \"make gen/golden-files\", verify and commit the changes", goldenPath)
124123
}
125124

126125
// normalizeGoldenFile replaces any strings that are system or timing dependent

0 commit comments

Comments
 (0)